# Generated by Django 3.2.16 on 2023-01-24 15:58

from django.db import migrations


def rename_asia_pacific_tag(apps, schema_editor):
    # rename BarrierTag with title 'TOP-PRIORITY BARRIER' to 'TOP 100 PRIORITY BARRIER'
    BarrierTag = apps.get_model("metadata", "BarrierTag")
    BarrierTag.objects.filter(title="Asia Pacific Cross-Government Pilot").update(
        title="Asia Pacific Pilot"
    )


def reverse_rename_asia_pacific_tag(apps, schema_editor):
    # rename BarrierTag with title 'TOP 100 PRIORITY BARRIER' to 'TOP-PRIORITY BARRIER'
    BarrierTag = apps.get_model("metadata", "BarrierTag")
    BarrierTag.objects.filter(title="Asia Pacific Pilot").update(
        title="Asia Pacific Cross-Government Pilot"
    )


class Migration(migrations.Migration):

    dependencies = [
        ("metadata", "0030_add_rtp_tag"),
    ]

    operations = [
        migrations.RunPython(
            rename_asia_pacific_tag,
            reverse_code=reverse_rename_asia_pacific_tag,
        ),
    ]
