# Generated by Django 3.2.9 on 2021-12-05 18:17

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


class Migration(migrations.Migration):

    dependencies = [
        ('chronos', '0008_unique_constraints'),
        ('core', '0020_pdf_file_person_optional'),
        ('evalu', '0007_drop_reference_registration'),
    ]

    operations = [
        migrations.CreateModel(
            name='ComparisonGroup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('extended_data', models.JSONField(default=dict, editable=False)),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Comparison group',
                'verbose_name_plural': 'Comparison groups',
            },
        ),
        migrations.CreateModel(
            name='ComparisonResult',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('extended_data', models.JSONField(default=dict, editable=False)),
                ('result', models.TextField(verbose_name='Result')),
            ],
            options={
                'verbose_name': 'Comparison result',
                'verbose_name_plural': 'Comparison results',
            },
        ),
        migrations.AlterModelManagers(
            name='evaluationphase',
            managers=[
            ],
        ),
        migrations.AlterModelManagers(
            name='evaluationregistration',
            managers=[
            ],
        ),
        migrations.RemoveConstraint(
            model_name='doneevaluation',
            name='group_evaluated_by_site_unique',
        ),
        migrations.AlterField(
            model_name='evaluationregistration',
            name='privacy_form',
            field=models.FileField(blank=True, default='', upload_to='', verbose_name='Submitted privacy form as PDF'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='evaluationresult',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='evalu.evaluationitem', verbose_name='Question'),
        ),
        migrations.AddConstraint(
            model_name='doneevaluation',
            constraint=models.UniqueConstraint(fields=('group', 'evaluated_by'), name='registration_group_evaluated_by_site_unique'),
        ),
        migrations.AddField(
            model_name='comparisonresult',
            name='comparison_group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='evalu.comparisongroup', verbose_name='Comparison group'),
        ),
        migrations.AddField(
            model_name='comparisonresult',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comparison_results', to='evalu.evaluationitem', verbose_name='Question'),
        ),
        migrations.AddField(
            model_name='comparisonresult',
            name='subject',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='evalu_results', to='chronos.subject', verbose_name='Subject'),
        ),
        migrations.AddField(
            model_name='comparisongroup',
            name='groups',
            field=models.ManyToManyField(to='core.Group', verbose_name='Groups'),
        ),
        migrations.AddField(
            model_name='comparisongroup',
            name='phase',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comparison_groups', to='evalu.evaluationphase', verbose_name='Evaluation phase'),
        ),
    ]
