# Generated by Django 5.0.8 on 2024-08-24 14:06

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0065_calendarevent_update_timezone_constraints'),
        ('evalu', '0018_evaluationpart_optional'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='doneevaluation',
            name='registration_group_evaluated_by_site_unique',
        ),
        migrations.RemoveConstraint(
            model_name='evaluationgroup',
            name='registration_group_site_unique',
        ),
        migrations.RemoveConstraint(
            model_name='evaluationpart',
            name='order_site_unique',
        ),
        migrations.RemoveConstraint(
            model_name='evaluationpart',
            name='name_site_unique',
        ),
        migrations.RemoveConstraint(
            model_name='evaluationregistration',
            name='person_phase_site_unique',
        ),
    ] + [
        migrations.RunSQL(
            f"ALTER TABLE evalu_{model_name} drop column if exists site_id;"
        ) for model_name  in
        [
            "evaluationphase",
            "comparisongroup",
            "evaluationregistration",
            "evaluationgroup",
            "doneevaluation",
            "evaluationpart",
            "evaluationitem",
            "customevaluationitem",
            "evaluationresult",
            "comparisonresult",
            "doneevaluationcomparison",
        ]
    ] + [
        migrations.AddField(
            model_name='comparisongroup',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='comparisonresult',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='doneevaluation',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='doneevaluationcomparison',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationgroup',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationitem',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationpart',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationphase',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationregistration',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AddField(
            model_name='evaluationresult',
            name='managed_by_app_label',
            field=models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance'),
        ),
        migrations.AlterField(
            model_name='evaluationpart',
            name='name',
            field=models.CharField(max_length=255, unique=True, verbose_name='Name'),
        ),
        migrations.AlterField(
            model_name='evaluationpart',
            name='order',
            field=models.IntegerField(unique=True, verbose_name='Order'),
        ),
        migrations.AddConstraint(
            model_name='doneevaluation',
            constraint=models.UniqueConstraint(fields=('group', 'evaluated_by'), name='registration_group_evaluated_unique'),
        ),
        migrations.AddConstraint(
            model_name='evaluationgroup',
            constraint=models.UniqueConstraint(fields=('registration', 'group'), name='registration_group_unique'),
        ),
        migrations.AddConstraint(
            model_name='evaluationregistration',
            constraint=models.UniqueConstraint(fields=('person', 'phase'), name='person_phase_unique'),
        ),
    ]
