# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-31 19:42


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


class Migration(migrations.Migration):

    dependencies = [
        ('coursedashboards', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('curriculum', models.CharField(max_length=6)),
                ('course_number', models.PositiveSmallIntegerField()),
                ('section_id', models.CharField(max_length=2)),
            ],
            options={
                'db_table': 'Course',
            },
        ),
        migrations.CreateModel(
            name='CourseOffering',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('current_enrollment', models.PositiveSmallIntegerField()),
                ('limit_estimate_enrollment', models.PositiveSmallIntegerField()),
                ('canvas_course_url', models.CharField(max_length=2000)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Course')),
            ],
            options={
                'db_table': 'CourseOffering',
            },
        ),
        migrations.CreateModel(
            name='Instructor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Course')),
            ],
            options={
                'db_table': 'Instructor',
            },
        ),
        migrations.CreateModel(
            name='Major',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('major', models.CharField(db_index=True, max_length=128, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Registration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grade', models.CharField(max_length=5, null=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Course')),
            ],
            options={
                'db_table': 'Registration',
            },
        ),
        migrations.CreateModel(
            name='StudentMajor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('major', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Major')),
            ],
            options={
                'db_table': 'StudentMajor',
            },
        ),
        migrations.CreateModel(
            name='Term',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quarter', models.CharField(choices=[(b'spring', b'Spring'), (b'summer', b'Summer'), (b'autumn', b'Autumn'), (b'winter', b'Winter')], max_length=6)),
                ('year', models.PositiveSmallIntegerField()),
                ('last_queried', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.RemoveField(
            model_name='user',
            name='last_visit',
        ),
        migrations.AddField(
            model_name='user',
            name='display_name',
            field=models.CharField(max_length=250, null=True),
        ),
        migrations.AddField(
            model_name='user',
            name='email',
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='studentmajor',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.User'),
        ),
        migrations.AddField(
            model_name='registration',
            name='term',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Term'),
        ),
        migrations.AddField(
            model_name='registration',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.User'),
        ),
        migrations.AddField(
            model_name='instructor',
            name='term',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Term'),
        ),
        migrations.AddField(
            model_name='instructor',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.User'),
        ),
        migrations.AddField(
            model_name='courseoffering',
            name='term',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='coursedashboards.Term'),
        ),
        migrations.AlterUniqueTogether(
            name='course',
            unique_together=set([('curriculum', 'course_number', 'section_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='studentmajor',
            unique_together=set([('user', 'major')]),
        ),
        migrations.AlterUniqueTogether(
            name='registration',
            unique_together=set([('user', 'term', 'course')]),
        ),
        migrations.AlterUniqueTogether(
            name='instructor',
            unique_together=set([('user', 'term', 'course')]),
        ),
        migrations.AlterUniqueTogether(
            name='courseoffering',
            unique_together=set([('term', 'course')]),
        ),
    ]
