<gh_stars>0
# Generated by Django 3.1.13 on 2021-12-03 10:19

import uuid

from django.db import migrations, models


def generate_uuid(apps, schema_editor):
    ApplicationEvent = apps.get_model('applications', 'ApplicationEvent')
    for obj in ApplicationEvent.objects.filter(uuid=None):
        obj.uuid = uuid.uuid4()
        obj.save(update_fields=['uuid'])


class Migration(migrations.Migration):

    dependencies = [
        ('applications', '0050_modify_purpose_foreign_keys'),
    ]

    operations = [
        migrations.AlterField(
            model_name='applicationevent',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False, null=True),
        ),
        migrations.RunPython(generate_uuid, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='applicationevent',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True),
        ),
    ]

# Generated by Django 3.1.13 on 2021-12-03 10:19

import uuid

from django.db import migrations, models


def generate_uuid(apps, schema_editor):
    ApplicationEvent = apps.get_model('applications', 'ApplicationEvent')
    for obj in ApplicationEvent.objects.filter(uuid=None):
        obj.uuid = uuid.uuid4()
        obj.save(update_fields=['uuid'])


class Migration(migrations.Migration):

    dependencies = [
        ('applications', '0050_modify_purpose_foreign_keys'),
    ]

    operations = [
        migrations.AlterField(
            model_name='applicationevent',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False, null=True),
        ),
        migrations.RunPython(generate_uuid, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='applicationevent',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True),
        ),
    ]
# Generated by Django 3.1.13 on 2021-12-03 10:19