# Generated by Django 4.2 on 2023-11-21 11:34

from django.db import migrations
import uuid


def gen_uuid(apps, schema_editor):
    CaptionedImage = apps.get_model("wagtailimagecaptions", "CaptionedImage")

    for row in CaptionedImage.objects.all():
        row.uuid = uuid.uuid4()
        row.save(update_fields=["uuid"])


class Migration(migrations.Migration):
    dependencies = [
        ("wagtailimagecaptions", "0003_captionedimage_byline_and_more"),
    ]

    operations = [
        migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop),
    ]
