# 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 = [
        ("files", "0001_initial"),
        ("course", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("learnpath", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="coursesessionuser",
            name="expert",
            field=models.ManyToManyField(
                blank=True, related_name="expert", to="learnpath.Circle"
            ),
        ),
        migrations.AddField(
            model_name="coursesessionuser",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="coursesession",
            name="course",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="course.course"
            ),
        ),
        migrations.AddField(
            model_name="coursepage",
            name="course",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.PROTECT, to="course.course"
            ),
        ),
        migrations.AddField(
            model_name="coursecompletion",
            name="course_session",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="course.coursesession"
            ),
        ),
        migrations.AddField(
            model_name="coursecompletion",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="coursecategory",
            name="course",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="course.course"
            ),
        ),
        migrations.AddField(
            model_name="circledocument",
            name="course_session",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="course.coursesession"
            ),
        ),
        migrations.AddField(
            model_name="circledocument",
            name="file",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE, to="files.uploadfile"
            ),
        ),
        migrations.AddField(
            model_name="circledocument",
            name="learning_sequence",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="learnpath.learningsequence",
            ),
        ),
        migrations.AddConstraint(
            model_name="coursesessionuser",
            constraint=models.UniqueConstraint(
                fields=("course_session", "user"),
                name="course_session_user_unique_course_session_user",
            ),
        ),
        migrations.AddConstraint(
            model_name="coursecompletion",
            constraint=models.UniqueConstraint(
                fields=("user", "page_key", "course_session"),
                name="course_completion_unique_user_page_key",
            ),
        ),
    ]
