# Generated by Django 3.1.7 on 2021-04-10 06:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DeptInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deptName', models.CharField(max_length=25, verbose_name='学院名称')),
                ('deptAbstract', models.TextField(verbose_name='学院简介')),
            ],
        ),
        migrations.CreateModel(
            name='ExtendMajorInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='MajorInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('majorName', models.CharField(max_length=25, verbose_name='专业名称')),
                ('isPostgraduate', models.BooleanField(default=False, verbose_name='本科生/研究生')),
                ('studentNum', models.IntegerField(default=0, verbose_name='学生人数')),
                ('underyear', models.CharField(choices=[('01', '大一'), ('02', '大二'), ('03', '大三'), ('04', '大四'), ('11', '研一'), ('12', '研二'), ('13', '研三')], max_length=2, verbose_name='年级')),
                ('semesterChoice', models.CharField(choices=[('0', '上'), ('1', '下')], default='0', max_length=1, verbose_name='学期')),
                ('DeptID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.deptinfo', verbose_name='隶属学院')),
            ],
        ),
        migrations.CreateModel(
            name='SchoolYearInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schoolYearName', models.TextField(verbose_name='学年名称')),
                ('schoolYearStart', models.DateField(default=9956, verbose_name='起始日期')),
                ('schoolYearEnd', models.DateField(default=9956, verbose_name='终止日期')),
            ],
        ),
        migrations.CreateModel(
            name='Relationship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='删除标记')),
                ('startDate', models.DateField(verbose_name='起始日期')),
                ('endDate', models.DateField(default=9956, verbose_name='终止日期')),
                ('relation', models.CharField(choices=[('pg', '研究生'), ('ug', '本科生'), ('gd', '已毕业'), ('qd', '已退学/延期毕业'), ('dl', '休学')], default='ug', max_length=2, verbose_name='学生类型')),
                ('underYear', models.CharField(choices=[('01', '大一'), ('02', '大二'), ('03', '大三'), ('04', '大四'), ('11', '研一'), ('12', '研二'), ('13', '研三')], default='01', max_length=2, verbose_name='学生年级')),
                ('ExtendMajor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.extendmajorinfo')),
                ('Majority', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.majorinfo')),
                ('SchoolYearInfo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='grade_info.schoolyearinfo')),
                ('User', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='majorinfo',
            name='Members',
            field=models.ManyToManyField(through='grade_info.Relationship', to=settings.AUTH_USER_MODEL, verbose_name='专业关系'),
        ),
        migrations.AddField(
            model_name='majorinfo',
            name='SchoolYearID',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.schoolyearinfo', verbose_name='学年信息'),
        ),
        migrations.CreateModel(
            name='LessonInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='删除标记')),
                ('lessonName', models.CharField(max_length=25, verbose_name='课程名称')),
                ('examineFlag', models.CharField(choices=[('bl', '考察'), ('bt', '考核')], default='bt', max_length=2, verbose_name='考查方式')),
                ('classification', models.CharField(choices=[('cb', '公共基础'), ('pe', '体育'), ('sc', '证书'), ('ot', '其他'), ('cm', '公共必修'), ('uc', '未分类'), ('op', '选修'), ('pf', '专业'), ('pm', '专业必修'), ('po', '专业选修'), ('pb', '专业基础'), ('cc', '校公选课'), ('lb', '大类基础'), ('eb', '基础教育'), ('fb', '平台基础'), ('ps', '实践环节'), ('ee', '扩展英语')], default='cb', max_length=2, verbose_name='课程类别')),
                ('credit', models.DecimalField(decimal_places=2, max_digits=3, verbose_name='学分')),
                ('lessonClass', models.IntegerField(default=0, verbose_name='本科生/研究生')),
                ('AffiliatedMajor', models.ManyToManyField(to='grade_info.MajorInfo', verbose_name='隶属专业')),
                ('SchoolYearID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.schoolyearinfo', verbose_name='学年信息')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GradeInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='删除标记')),
                ('credit', models.DecimalField(decimal_places=2, max_digits=3, verbose_name='学分')),
                ('grade', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='成绩')),
                ('ifRestudied', models.BooleanField(default=True)),
                ('testKind', models.CharField(choices=[('re', '重考'), ('rs', '重修'), ('np', '正常考试'), ('ee', '补考'), ('nt', '旷考'), ('rl', '免修'), ('tl', '缓考'), ('ot', '其它')], default='np', max_length=2, verbose_name='考试性质')),
                ('optionChoice', models.CharField(choices=[('mu', '必修'), ('ch', '选修'), ('ei', '任选'), ('ot', '其他')], default='mu', max_length=2, verbose_name='课程性质')),
                ('LessonID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.lessoninfo')),
                ('SchoolYearID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.schoolyearinfo', verbose_name='学年ID')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='extendmajorinfo',
            name='MajorInfo',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grade_info.majorinfo'),
        ),
    ]
