# Generated by Django 5.0.6 on 2024-05-22 20:33

from django.db import migrations


def rename(apps, old_name, new_name):
    UIItem = apps.get_model("djangocms_frontend", "FrontendUIItem")
    UIItem.objects.filter(ui_item=old_name).update(ui_item=new_name, plugin_type=f"{new_name}Plugin")


class Migration(migrations.Migration):

    dependencies = [
        ('link', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(
            lambda apps, schema_editor: rename(apps, "Link", "TextLink"),
            lambda apps, schema_editor: rename(apps, "TextLink", "Link"),
            elidable=True,
        ),
    ]
