# Generated by Django 4.1.2 on 2022-11-01 20:05

from django.conf import settings
import django.contrib.postgres.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('username', models.CharField(max_length=20, primary_key=True, serialize=False, unique=True)),
                ('pid', models.IntegerField()),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email', models.EmailField(blank=True, max_length=50, null=True, verbose_name='Email address')),
                ('password', models.CharField(max_length=128, null=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['pid'],
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=35)),
            ],
            options={
                'ordering': ['number'],
            },
        ),
        migrations.CreateModel(
            name='Major',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('degree', models.CharField(max_length=25)),
            ],
            options={
                'ordering': ['subject_area'],
            },
        ),
        migrations.CreateModel(
            name='SubjectArea',
            fields=[
                ('title', models.CharField(max_length=25, primary_key=True, serialize=False)),
            ],
            options={
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Faculty',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('role', models.CharField(max_length=15)),
            ],
            options={
                'ordering': ['role'],
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['major'],
            },
        ),
        migrations.CreateModel(
            name='Semester',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('month', models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)], verbose_name='Number of month (1-12)')),
                ('year', models.IntegerField(default=2000, validators=[django.core.validators.MinValueValidator(2000), django.core.validators.MaxValueValidator(3000)], verbose_name='Year (4 digits)')),
            ],
            options={
                'ordering': ['year'],
                'unique_together': {('month', 'year')},
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference', models.IntegerField(validators=[django.core.validators.MaxValueValidator(100000), django.core.validators.MinValueValidator(0)])),
                ('name', models.CharField(max_length=10)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.course')),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.semester')),
                ('instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.faculty')),
            ],
            options={
                'ordering': ['reference'],
                'unique_together': {('semester', 'reference')},
            },
        ),
        migrations.CreateModel(
            name='Responses',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gen_answers', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)]), size=None)),
                ('cs_answers', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)]), size=None)),
                ('major_answers', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)]), size=None)),
                ('comments', models.TextField(blank=True, null=True)),
                ('major', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.major')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.section')),
            ],
            options={
                'ordering': ['section'],
            },
        ),
        migrations.CreateModel(
            name='Outcome',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('heading', models.CharField(max_length=150)),
                ('questions', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.semester')),
            ],
            options={
                'ordering': ['heading'],
                'unique_together': {('heading', 'semester')},
            },
        ),
        migrations.CreateModel(
            name='MajorQuestion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('questions', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)),
                ('major', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.major')),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.semester')),
            ],
            options={
                'ordering': ['major'],
            },
        ),
        migrations.AddField(
            model_name='major',
            name='subject_area',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.subjectarea'),
        ),
        migrations.CreateModel(
            name='GenQuestion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=100)),
                ('order', models.IntegerField(default=1)),
                ('semester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.semester')),
            ],
            options={
                'ordering': ['order'],
            },
        ),
        migrations.AddField(
            model_name='course',
            name='outcomes',
            field=models.ManyToManyField(blank=True, to='ces_fall_rest_api.outcome'),
        ),
        migrations.AddField(
            model_name='course',
            name='semester',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.semester'),
        ),
        migrations.AddField(
            model_name='course',
            name='subject_area',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.subjectarea'),
        ),
        migrations.AddField(
            model_name='subjectarea',
            name='coordinator',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.faculty'),
        ),
        migrations.CreateModel(
            name='StudentInSection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('evaluated', models.BooleanField(default=False)),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.section')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='ces_fall_rest_api.student')),
            ],
            options={
                'ordering': ['student'],
            },
        ),
        migrations.AddField(
            model_name='student',
            name='major',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ces_fall_rest_api.major'),
        ),
        migrations.AlterUniqueTogether(
            name='major',
            unique_together={('degree', 'subject_area')},
        ),
    ]
