# Generated by Django 3.2.13 on 2023-05-12 15:29

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("course", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("assignment", "0002_assignmentcompletionauditlog_assignment_user"),
    ]

    operations = [
        migrations.AddField(
            model_name="assignmentcompletionauditlog",
            name="course_session",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="course.coursesession",
            ),
        ),
        migrations.AddField(
            model_name="assignmentcompletionauditlog",
            name="evaluation_user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="assignmentcompletion",
            name="assignment",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="assignment.assignment"
            ),
        ),
        migrations.AddField(
            model_name="assignmentcompletion",
            name="assignment_user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="assignmentcompletion",
            name="course_session",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="course.coursesession"
            ),
        ),
        migrations.AddField(
            model_name="assignmentcompletion",
            name="evaluation_user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddConstraint(
            model_name="assignmentcompletion",
            constraint=models.UniqueConstraint(
                fields=("assignment_user", "assignment", "course_session"),
                name="assignment_completion_unique_user_assignment_course_session",
            ),
        ),
    ]
