# Generated by Django 4.2.20 on 2025-04-08 10:12

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


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("pedagogy", "0003_alter_uv_language"),
    ]

    operations = [
        migrations.RenameModel(old_name="UV", new_name="UE"),
        migrations.RenameModel(old_name="UVComment", new_name="UEComment"),
        migrations.RenameModel(old_name="UVCommentReport", new_name="UECommentReport"),
        migrations.RenameModel(old_name="UVResult", new_name="UEResult"),
        migrations.RenameField(model_name="ueresult", old_name="uv", new_name="ue"),
        migrations.RenameField(model_name="uecomment", old_name="uv", new_name="ue"),
        migrations.AlterField(
            model_name="ue",
            name="credits",
            field=models.PositiveIntegerField(verbose_name="credits"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="hours_CM",
            field=models.PositiveIntegerField(default=0, verbose_name="hours CM"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="hours_TD",
            field=models.PositiveIntegerField(default=0, verbose_name="hours TD"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="hours_TE",
            field=models.PositiveIntegerField(default=0, verbose_name="hours TE"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="hours_THE",
            field=models.PositiveIntegerField(default=0, verbose_name="hours THE"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="hours_TP",
            field=models.PositiveIntegerField(default=0, verbose_name="hours TP"),
        ),
        migrations.AlterField(
            model_name="ue",
            name="manager",
            field=models.CharField(max_length=300, verbose_name="ue manager"),
        ),
        migrations.AlterField(
            model_name="ueresult",
            name="ue",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="results",
                to="pedagogy.ue",
                verbose_name="ue",
            ),
        ),
        migrations.AlterField(
            model_name="ue",
            name="author",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ue_created",
                to=settings.AUTH_USER_MODEL,
                verbose_name="author",
            ),
        ),
        migrations.AlterField(
            model_name="ue",
            name="code",
            field=models.CharField(
                max_length=10,
                unique=True,
                validators=[
                    django.core.validators.RegexValidator(
                        message=(
                            "The code of an UE must only contains "
                            "uppercase characters without accent and numbers"
                        ),
                        regex="([A-Z0-9]+)",
                    )
                ],
                verbose_name="code",
            ),
        ),
        migrations.AlterField(
            model_name="uecomment",
            name="author",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ue_comments",
                to=settings.AUTH_USER_MODEL,
                verbose_name="author",
            ),
        ),
        migrations.AlterField(
            model_name="uecomment",
            name="comment",
            field=models.TextField(blank=True, default="", verbose_name="comment"),
        ),
        migrations.AlterField(
            model_name="uecomment",
            name="ue",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="comments",
                to="pedagogy.ue",
                verbose_name="ue",
            ),
        ),
        migrations.AlterField(
            model_name="uecommentreport",
            name="reporter",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="reported_ue_comment",
                to=settings.AUTH_USER_MODEL,
                verbose_name="reporter",
            ),
        ),
        migrations.AlterField(
            model_name="ueresult",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ue_results",
                to=settings.AUTH_USER_MODEL,
                verbose_name="user",
            ),
        ),
    ]
