# Generated by Django 2.2 on 2019-04-21 13:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Student',
            fields=[
                ('no', models.CharField(max_length=20, primary_key=True, serialize=False, verbose_name='学号')),
                ('name', models.CharField(max_length=20, verbose_name='姓名')),
                ('password_hash', models.CharField(max_length=100)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')),
            ],
            options={
                'verbose_name': '学生',
                'verbose_name_plural': '学生',
                'ordering': ['no'],
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('no', models.CharField(max_length=8, primary_key=True, serialize=False, verbose_name='教师号')),
                ('name', models.CharField(max_length=20, verbose_name='姓名')),
                ('password_hash', models.CharField(max_length=100)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')),
            ],
            options={
                'verbose_name': '教师',
                'verbose_name_plural': '教师',
                'ordering': ['no'],
            },
        ),
        migrations.CreateModel(
            name='FaceUrl',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.CharField(max_length=30, verbose_name='图片路径')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='faces', to='sign.Student', verbose_name='所属学生')),
            ],
            options={
                'verbose_name': '照片路径',
                'verbose_name_plural': '照片路径',
                'ordering': ['-create_time'],
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('no', models.CharField(max_length=8, primary_key=True, serialize=False, verbose_name='课程号')),
                ('course_name', models.CharField(max_length=40, verbose_name='课程名')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='courses', to='sign.Teacher', verbose_name='授课教师')),
            ],
            options={
                'verbose_name': '课程',
                'verbose_name_plural': '课程',
                'ordering': ['-create_time'],
            },
        ),
        migrations.CreateModel(
            name='SignSheet',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID')),
                ('sign_time', models.DateTimeField(auto_now=True, verbose_name='最新时间')),
                ('count', models.IntegerField(verbose_name='签到次数')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='signsheets', to='sign.Course', verbose_name='课程号')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='signsheets', to='sign.Student', verbose_name='学号')),
            ],
            options={
                'verbose_name': '签到表',
                'verbose_name_plural': '签到表',
                'ordering': ['-sign_time'],
                'unique_together': {('student', 'course')},
            },
        ),
    ]
