# Generated by Django 3.1 on 2021-05-17 15:54

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(db_index=True, max_length=254, unique=True, verbose_name='Email Address')),
                ('user_name', models.CharField(db_index=True, max_length=20, unique=True)),
                ('first_name', models.CharField(max_length=20)),
                ('last_name', models.CharField(blank=True, max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_staff', models.BooleanField(default=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_verified', models.BooleanField(default=False)),
                ('user_type', models.CharField(choices=[('HOD', 'Hod'), ('Admin', 'Admin'), ('Professor', 'Professor')], default='Professor', max_length=10)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HOD',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='HODs', serialize=False, to='authentication.user')),
                ('date_of_joining', models.DateField()),
                ('department', models.CharField(choices=[('Computer Science', 'Cse'), ('Mechanical', 'Mechanical'), ('Electronics', 'Electronics'), ('Electrical', 'Electrical')], max_length=20)),
                ('degree', models.CharField(max_length=20)),
            ],
            options={
                'verbose_name_plural': 'HODs',
                'default_related_name': 'HODs',
            },
            bases=('authentication.user',),
        ),
        migrations.CreateModel(
            name='Professor',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='Professors', serialize=False, to='authentication.user')),
                ('date_of_joining', models.DateField()),
                ('department', models.CharField(choices=[('Computer Science', 'Cse'), ('Mechanical', 'Mechanical'), ('Electronics', 'Electronics'), ('Electrical', 'Electrical')], max_length=20)),
                ('degree', models.CharField(max_length=20)),
            ],
            options={
                'verbose_name_plural': 'Professors',
                'default_related_name': 'Professors',
            },
            bases=('authentication.user',),
        ),
        migrations.AddConstraint(
            model_name='professor',
            constraint=models.CheckConstraint(check=models.Q(department__in=['Computer Science', 'Mechanical', 'Electronics', 'Electrical']), name='authentication_professor_invalid_department_type'),
        ),
        migrations.AddConstraint(
            model_name='hod',
            constraint=models.CheckConstraint(check=models.Q(department__in=['Computer Science', 'Mechanical', 'Electronics', 'Electrical']), name='authentication_hod_invalid_department_type'),
        ),
    ]
