"""Seed the My Sign (a.k.a. My Significator) applet on billboard.

Sprint 4 of the My Sea roadmap. "Significator" remains the storage-layer
term (User.significator FK, room sig-select); the applet itself is "My
Sign" (the "My X" convention for applet names) while the standalone page
wordmark reads "Game Sign" (the "Game/Dash/Bill X" convention for pages).
4×6 (narrow + tall), seeded after all other billboard applets so it
renders at the end of the billboard grid. Shows the user's saved
significator card or a blank state.
"""
from django.db import migrations


def seed(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.update_or_create(
        slug="my-sign",
        defaults={
            "name": "My Sign",
            "context": "billboard",
            "default_visible": True,
            "grid_cols": 4,
            "grid_rows": 6,
        },
    )


def unseed(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.filter(slug="my-sign").delete()


class Migration(migrations.Migration):

    dependencies = [
        ("applets", "0008_seed_my_sea_applet"),
    ]

    operations = [
        migrations.RunPython(seed, unseed),
    ]
