# Generated by Django 2.2.4 on 2019-08-05 01:10

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('description', models.TextField(blank=True, null=True)),
                ('due_date', models.DateTimeField()),
                ('date', models.DateTimeField()),
                ('points', models.PositiveSmallIntegerField()),
                ('attempts', models.PositiveSmallIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('description', models.TextField(blank=True, null=True)),
                ('students', models.ManyToManyField(blank=True, related_name='courses', to='users.Student')),
            ],
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('points', models.PositiveSmallIntegerField(default=0)),
                ('submitted_date', models.DateTimeField(auto_now_add=True)),
                ('assignment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='grader.Assignment')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='users.Student')),
            ],
        ),
        migrations.CreateModel(
            name='CodeFileAssignment',
            fields=[
                ('assignment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='grader.Assignment')),
                ('code_template', models.FileField(null=True, upload_to=grader.models.template_file_name)),
                ('instructions', models.TextField(blank=True, null=True)),
                ('tester_path', models.FileField(upload_to=grader.models.tester_file_name)),
            ],
            bases=('grader.assignment',),
        ),
        migrations.CreateModel(
            name='QuizAssignment',
            fields=[
                ('assignment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='grader.Assignment')),
                ('questions', models.TextField(blank=True, null=True)),
            ],
            bases=('grader.assignment',),
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('description', models.TextField(blank=True, null=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='units', to='grader.Course')),
            ],
        ),
        migrations.CreateModel(
            name='SubmissionCheck',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('passed', models.BooleanField()),
                ('details', models.TextField(blank=True, null=True)),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='checks', to='grader.Submission')),
            ],
        ),
        migrations.CreateModel(
            name='FileUpload',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to=grader.models.content_file_name)),
                ('original_filename', models.CharField(max_length=128)),
                ('upload_date', models.DateTimeField(auto_now_add=True)),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='grader.Submission')),
            ],
        ),
        migrations.CreateModel(
            name='CourseCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=16)),
                ('courses', models.ManyToManyField(related_name='courses', to='grader.Course')),
            ],
        ),
        migrations.AddField(
            model_name='assignment',
            name='unit',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assignments', to='grader.Unit'),
        ),
    ]
