"""Seed the Pronouns applet on the Game Kit page (3x3, default visible)."""
from django.db import migrations


SLUG = "pronouns"
NAME = "Pronouns"
CONTEXT = "game-kit"


def forward(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.get_or_create(
        slug=SLUG,
        defaults={
            "name": NAME,
            "context": CONTEXT,
            "default_visible": True,
            "grid_cols": 3,
            "grid_rows": 3,
        },
    )


def backward(apps, schema_editor):
    Applet = apps.get_model("applets", "Applet")
    Applet.objects.filter(slug=SLUG).delete()


class Migration(migrations.Migration):
    dependencies = [
        ("applets", "0004_rename_billboard_applet_slugs"),
    ]
    operations = [migrations.RunPython(forward, backward)]
