# Generated by Django 3.1.8 on 2021-07-14 02:17

from django.db import migrations, models
import uuid


def set_uuids(apps, schema):
    Result = apps.get_model("aims", "Result")
    for result in Result.objects.all():
        result.uuid = uuid.uuid4()
        result.save()

    ResultIndicator = apps.get_model("aims", "ResultIndicator")
    for indicator in ResultIndicator.objects.all():
        indicator.uuid = uuid.uuid4()
        indicator.save()


def no_op(apps, schema):
    ...


class Migration(migrations.Migration):

    dependencies = [
        ("aims", "0090_auto_20210615_0152"),
    ]
    operations = [
        migrations.AddField(
            model_name="result",
            name="uuid",
            field=models.UUIDField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name="resultindicator",
            name="uuid",
            field=models.UUIDField(blank=True, null=True),
        ),
        migrations.RunPython(set_uuids, no_op),
    ]
