# Generated by Django 2.2.18 on 2021-03-04 14:11

from django.db import migrations, models
from django.db.models.expressions import F


def initial_modified_properties(apps, schema_editor):
    for model in [
        "Answer",
        "AnswerDocument",
        "Document",
        "DynamicOption",
        "File",
        "Form",
        "FormQuestion",
        "Option",
        "Question",
        "QuestionOption",
    ]:
        Model = apps.get_model(f"caluma_form.{model}")
        Model.objects.update(
            modified_by_user=F("created_by_user"),
            modified_by_group=F("created_by_group"),
        )


class Migration(migrations.Migration):

    dependencies = [
        ("caluma_form", "0039_merge_20210114_0956"),
    ]

    operations = [
        migrations.AddField(
            model_name="answer",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="answer",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="answerdocument",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="answerdocument",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="document",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="document",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="dynamicoption",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="dynamicoption",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="form",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="form",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="formquestion",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="formquestion",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalanswer",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalanswer",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalanswerdocument",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalanswerdocument",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaldocument",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaldocument",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaldynamicoption",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaldynamicoption",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalfile",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalfile",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalform",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalform",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalformquestion",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalformquestion",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaloption",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicaloption",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalquestion",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalquestion",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalquestionoption",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="historicalquestionoption",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="option",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="option",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="question",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="question",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="questionoption",
            name="modified_by_group",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.AddField(
            model_name="questionoption",
            name="modified_by_user",
            field=models.CharField(
                blank=True, db_index=True, max_length=150, null=True
            ),
        ),
        migrations.RunPython(initial_modified_properties, migrations.RunPython.noop),
    ]
