"""Retitle the My Sky + My Sea applets — "SkyDrive" / "Sea of Cards".

User-spec 2026-06-08: the Sky/Sea applets get distinct planetary identities
(SkyDrive on the uranium ramp, Sea of Cards on the neptunium ramp). This updates
the gear-menu toggle label, which renders `Applet.name` (the applet h2 titles are
hardcoded in the partials and were changed alongside). A deliberate departure
from the "My X" applet-naming convention (see migration 0010) for these two
surfaces. Slugs (my-sky / my-sea) stay put — URLs + selectors unchanged.
"""
from django.db import migrations


def rename(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.filter(slug="my-sky").update(name="SkyDrive")
    Applet.objects.filter(slug="my-sea").update(name="Sea of Cards")


def unrename(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.filter(slug="my-sky").update(name="My Sky")
    Applet.objects.filter(slug="my-sea").update(name="My Sea")


class Migration(migrations.Migration):

    dependencies = [
        ("applets", "0013_wallet_shop_display_order"),
    ]

    operations = [
        migrations.RunPython(rename, unrename),
    ]
