# Generated by Django 2.0.4 on 2018-04-29 10:49

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='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('operation', models.CharField(max_length=100)),
                ('time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'log',
            },
        ),
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, null=True)),
                ('gender', models.CharField(choices=[('M', '男'), ('F', '女')], max_length=1)),
                ('class_name', models.CharField(max_length=20, null=True)),
                ('user_type', models.CharField(choices=[('A', '管理员'), ('T', '教师'), ('S', '学生')], max_length=1)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'myuser',
            },
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file1_name', models.CharField(max_length=100)),
                ('file2_name', models.CharField(max_length=100)),
                ('percent1', models.IntegerField()),
                ('percent2', models.IntegerField()),
                ('matched_lines', models.CharField(max_length=100)),
                ('file1_code', models.TextField()),
                ('file2_code', models.TextField()),
                ('time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'result',
            },
        ),
        migrations.CreateModel(
            name='Submit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('filename', models.CharField(max_length=30)),
                ('code', models.TextField()),
                ('time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'submit',
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('status', models.BooleanField(default=False)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='code_checking.MyUser')),
            ],
            options={
                'db_table': 'task',
            },
        ),
        migrations.AddField(
            model_name='submit',
            name='task',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='code_checking.Task'),
        ),
        migrations.AddField(
            model_name='submit',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='code_checking.MyUser'),
        ),
        migrations.AddField(
            model_name='result',
            name='task',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='code_checking.Task'),
        ),
        migrations.AddField(
            model_name='log',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='code_checking.MyUser'),
        ),
    ]
