"""Populate `shoptalk` for existing shop items + split BAND's description.

Pre-migration: `band-1.description` carried both the game function
("Admit All Entry") + the italic flavor ("unlimited free entry (BYOB)")
crammed onto one line. The wallet shop tooltip now uses the DRY four-
slot pattern of `.tt-title` / `.tt-description` / `.tt-shoptalk` /
`.tt-expiry` — same classes the Tokens row already styles — so the
flavor line moves to its own `shoptalk` field, mirroring how
`Token.tooltip_shoptalk` separates flavor from description.

Tithes don't carry shoptalk (their Token tooltips don't either).
"""
from django.db import migrations


def forward(apps, schema_editor):
    ShopItem = apps.get_model("lyric", "ShopItem")
    ShopItem.objects.filter(slug="band-1").update(
        description="Admit All Entry",
        shoptalk="Unlimited free entry (BYOB)",
    )


def reverse(apps, schema_editor):
    ShopItem = apps.get_model("lyric", "ShopItem")
    ShopItem.objects.filter(slug="band-1").update(
        description="Admit All Entry — unlimited free entry (BYOB)",
        shoptalk="",
    )


class Migration(migrations.Migration):

    dependencies = [
        ("lyric", "0011_shopitem_shoptalk"),
    ]

    operations = [
        migrations.RunPython(forward, reverse),
    ]
