# Generated by Django 3.2.6 on 2021-09-15 15:08

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


class Migration(migrations.Migration):

    dependencies = [
        ('evalu', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='EvaluationItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('extended_data', models.JSONField(default=dict, editable=False)),
                ('order', models.IntegerField(verbose_name='Order')),
                ('name', models.CharField(help_text='as shown in results', max_length=255, verbose_name='Name')),
                ('question', ckeditor.fields.RichTextField(help_text='as shown on evaluation form', verbose_name='Question')),
                ('item_type', models.CharField(choices=[('free_text', 'Free text'), ('agreement', 'Agreement')], max_length=255, verbose_name='Question type')),
                ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='evalu.evaluationpart', verbose_name='Evaluation part')),
            ],
            options={
                'verbose_name': 'Evaluation question',
                'verbose_name_plural': 'Evaluation questions',
            },
        ),
        migrations.RemoveField(
            model_name='evaluationresult',
            name='question',
        ),
        migrations.AddField(
            model_name='evaluationgroup',
            name='group_name',
            field=models.CharField(default='unknown', max_length=255, verbose_name='Group name'),
            preserve_default=False,
        ),
        migrations.DeleteModel(
            name='EvaluationQuestion',
        ),
        migrations.AddField(
            model_name='evaluationresult',
            name='item',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='evalu.evaluationitem', verbose_name='Question'),
            preserve_default=False,
        ),
        migrations.AddConstraint(
            model_name='evaluationitem',
            constraint=models.UniqueConstraint(fields=('part', 'order'), name='part_site_order_unique'),
        ),
    ]
