"""Seed the My Sea applet — Sprint 3 of the My Sea roadmap.

The applet itself is just a shell for now (header + horizontal scroll
container w. empty-state placeholder). Sprints 4+ will fill in the
sig-select / sea-select / gatekeeper phases that render in the dedicated
`my_sea.html` page reachable via the applet's header link.

Grid: 12 cols × 4 rows — wide horizontal banner so the latest draw's
10-card Celtic Cross spread can render left-to-right in the applet
aperture, scrollable like My Palette.
"""
from django.db import migrations


def seed(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.update_or_create(
        slug="my-sea",
        defaults={
            "name": "My Sea",
            "context": "gameboard",
            "default_visible": True,
            "grid_cols": 12,
            "grid_rows": 4,
        },
    )


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


class Migration(migrations.Migration):

    dependencies = [
        ("applets", "0007_rename_my_buddies_to_my_buds"),
    ]

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