# Generated by Django 4.2.6 on 2023-10-19 17:29

from django.db import migrations


def populate_content_block_names(apps, schema_editor):
    ContentBlock = apps.get_model("content_blocks", "ContentBlock")

    for content_block in ContentBlock.objects.all():
        content_block.name = (
            f"{content_block.content_block_template.name} #{content_block.id}"
        )
        content_block.save()


class Migration(migrations.Migration):

    dependencies = [
        ("content_blocks", "0007_contentblock_name_and_more"),
    ]

    operations = [
        migrations.RunPython(populate_content_block_names, migrations.RunPython.noop)
    ]
