# Generated by Django 3.1.7 on 2021-07-03 23:27

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('base', '0007_remove_assignment_teacher'),
    ]

    operations = [
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_path', models.FileField(blank=True, null=True, upload_to='submissionFile/')),
                ('grade', models.FloatField()),
            ],
        ),
        migrations.RemoveField(
            model_name='gradedassignment',
            name='assignment',
        ),
        migrations.RemoveField(
            model_name='gradedassignment',
            name='student',
        ),
        migrations.RemoveField(
            model_name='assignment',
            name='course',
        ),
        migrations.RemoveField(
            model_name='assignment',
            name='description',
        ),
        migrations.RemoveField(
            model_name='assignment',
            name='grade',
        ),
        migrations.RemoveField(
            model_name='assignment',
            name='student',
        ),
        migrations.RemoveField(
            model_name='assignment',
            name='title',
        ),
        migrations.AddField(
            model_name='assignment',
            name='post',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='base.post'),
        ),
        migrations.AddField(
            model_name='post',
            name='is_assignment',
            field=models.BooleanField(blank=True, default=False, null=True),
        ),
        migrations.AddField(
            model_name='post',
            name='title',
            field=models.CharField(blank=True, max_length=200, null=True),
        ),
        migrations.DeleteModel(
            name='AssignmentFile',
        ),
        migrations.DeleteModel(
            name='GradedAssignment',
        ),
        migrations.AddField(
            model_name='submission',
            name='post',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='base.post'),
        ),
        migrations.AddField(
            model_name='submission',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='submission',
            unique_together={('user', 'post')},
        ),
    ]
