# Generated by Django 5.2.9 on 2026-01-08 22:59

from django.db import migrations


OLD_TO_NEW = {
    "Raspberry Pi 4 Model B": "RPi 4 Model B",
    "Raspberry Pi Pinout": "RPi Pinout",
}


def update_reference_alt_text(apps, schema_editor):
    Reference = apps.get_model("links", "Reference")
    for old_text, new_text in OLD_TO_NEW.items():
        Reference.objects.filter(alt_text=old_text).update(alt_text=new_text)


def revert_reference_alt_text(apps, schema_editor):
    Reference = apps.get_model("links", "Reference")
    for old_text, new_text in OLD_TO_NEW.items():
        Reference.objects.filter(alt_text=new_text).update(alt_text=old_text)


class Migration(migrations.Migration):

    dependencies = [
        ("links", "0004_qrredirect_qrredirectlead"),
    ]

    operations = [
        migrations.RunPython(update_reference_alt_text, revert_reference_alt_text),
    ]
