# Generated by Django 5.2.9 on 2026-01-08 23:10

from django.db import migrations


OLD_URL = "https://www.mysql.com/"
NEW_URL = "https://www.sqlite.org/"
OLD_ALT_TEXT = "MySQL"
NEW_ALT_TEXT = "SQLite"


def update_reference_mysql_to_sqlite(apps, schema_editor):
    Reference = apps.get_model("links", "Reference")
    Reference.objects.filter(value=OLD_URL).update(value=NEW_URL)
    Reference.objects.filter(alt_text=OLD_ALT_TEXT).update(alt_text=NEW_ALT_TEXT)


def revert_reference_mysql_to_sqlite(apps, schema_editor):
    Reference = apps.get_model("links", "Reference")
    Reference.objects.filter(value=NEW_URL).update(value=OLD_URL)
    Reference.objects.filter(alt_text=NEW_ALT_TEXT).update(alt_text=OLD_ALT_TEXT)


class Migration(migrations.Migration):

    dependencies = [
        ("links", "0006_reference_media_files"),
    ]

    operations = [
        migrations.RunPython(
            update_reference_mysql_to_sqlite, revert_reference_mysql_to_sqlite
        ),
    ]
