# Generated by Django 2.2 on 2019-05-09 23:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('course_name', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('subject_code', models.CharField(max_length=4)),
                ('course_number', models.PositiveIntegerField(default=0)),
                ('credits', models.PositiveSmallIntegerField(default=0)),
                ('description', models.TextField(blank=True)),
            ],
            options={
                'db_table': 'course',
            },
        ),
        migrations.CreateModel(
            name='Curriculum',
            fields=[
                ('curriculum_name', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('admin_name', models.CharField(max_length=100)),
                ('admin_id', models.PositiveIntegerField(default=0)),
                ('min_credits', models.PositiveSmallIntegerField(default=0)),
                ('topic_coverage', models.CharField(choices=[('Extensive', 'Extensive'), ('Inclusive', 'Inclusive'), ('BasicPlus', 'BasicPlus'), ('Basic', 'Basic'), ('Unsatisfactory', 'Unsatisfactory'), ('Substandard', 'Substandard')], default='Basic', max_length=15)),
                ('goal_valid_credits', models.PositiveSmallIntegerField(default=0)),
                ('goal_valid', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'curriculum',
            },
        ),
        migrations.CreateModel(
            name='GradeDistribution',
            fields=[
                ('grade_distribution_id', models.AutoField(primary_key=True, serialize=False)),
                ('total_student', models.PositiveIntegerField(default=0)),
                ('A_plus', models.PositiveIntegerField(default=0)),
                ('A', models.PositiveIntegerField(default=0)),
                ('A_minus', models.PositiveIntegerField(default=0)),
                ('B_plus', models.PositiveIntegerField(default=0)),
                ('B', models.PositiveIntegerField(default=0)),
                ('B_minus', models.PositiveIntegerField(default=0)),
                ('C_plus', models.PositiveIntegerField(default=0)),
                ('C', models.PositiveIntegerField(default=0)),
                ('C_minus', models.PositiveIntegerField(default=0)),
                ('D_plus', models.PositiveIntegerField(default=0)),
                ('D', models.PositiveIntegerField(default=0)),
                ('D_minus', models.PositiveIntegerField(default=0)),
                ('Fail', models.PositiveIntegerField(default=0)),
                ('Withdraw', models.PositiveIntegerField(default=0)),
                ('Incomplete', models.PositiveIntegerField(default=0)),
            ],
            options={
                'db_table': 'grade_distribution',
            },
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('topic_id', models.AutoField(primary_key=True, serialize=False)),
                ('topic_name', models.CharField(max_length=50)),
                ('level', models.PositiveSmallIntegerField(choices=[(1, 'Level 1'), (2, 'Level 2'), (3, 'Level 3')])),
                ('subject_area', models.CharField(max_length=50)),
                ('units', models.DecimalField(decimal_places=1, max_digits=10)),
                ('curriculum_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Curriculum')),
            ],
            options={
                'db_table': 'topic',
            },
        ),
        migrations.CreateModel(
            name='TopicSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('topic_set_id', models.IntegerField(default=0)),
                ('assign_course_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Course')),
                ('topic_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Topic')),
            ],
            options={
                'db_table': 'topic_set',
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('section_id', models.PositiveIntegerField(default=0)),
                ('semester', models.CharField(choices=[('SP', 'Spring'), ('SM', 'Summer'), ('FA', 'Fall'), ('WT', 'Winter')], max_length=2)),
                ('student_count', models.PositiveIntegerField(default=0)),
                ('comment1', models.TextField(blank=True)),
                ('comment2', models.TextField(blank=True)),
                ('year', models.IntegerField(default=2019)),
                ('course_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Course')),
                ('grade_distribution_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.GradeDistribution')),
            ],
            options={
                'db_table': 'section',
            },
        ),
        migrations.CreateModel(
            name='Goal',
            fields=[
                ('goal_id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(max_length=255)),
                ('course_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Course')),
                ('curriculum_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Curriculum')),
                ('grade_distribution_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.GradeDistribution')),
            ],
            options={
                'db_table': 'goal',
            },
        ),
        migrations.CreateModel(
            name='CurriculumCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('required', models.BooleanField(default=False)),
                ('topic_set_id', models.IntegerField(default=0)),
                ('units_of_topic', models.PositiveSmallIntegerField(default=0)),
                ('course_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Course')),
                ('curriculum_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Curriculum')),
            ],
            options={
                'db_table': 'curriculum_course',
            },
        ),
        migrations.AddConstraint(
            model_name='course',
            constraint=models.UniqueConstraint(fields=('subject_code', 'course_number'), name='unique_course'),
        ),
        migrations.AddConstraint(
            model_name='topicset',
            constraint=models.UniqueConstraint(fields=('topic_set_id', 'assign_course_name', 'topic_id'), name='unique_topic_set'),
        ),
        migrations.AddConstraint(
            model_name='topic',
            constraint=models.UniqueConstraint(fields=('topic_id', 'curriculum_name'), name='unique_topic'),
        ),
        migrations.AddConstraint(
            model_name='section',
            constraint=models.UniqueConstraint(fields=('section_id', 'course_name', 'semester'), name='unique_section'),
        ),
        migrations.AddConstraint(
            model_name='curriculumcourse',
            constraint=models.UniqueConstraint(fields=('curriculum_name', 'course_name'), name='unique_curriculum_course'),
        ),
    ]
