# Generated by Django 5.2.4 on 2025-09-16 00:31

from django.db import migrations


def remove_cmd_sigil_root(apps, schema_editor):
    SigilRoot = apps.get_model("core", "SigilRoot")
    SigilRoot.objects.filter(prefix__iexact="CMD").delete()


def restore_cmd_sigil_root(apps, schema_editor):
    SigilRoot = apps.get_model("core", "SigilRoot")
    SigilRoot.objects.get_or_create(
        prefix="CMD",
        defaults={"context_type": "config"},
    )


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0019_evmodel_est_battery_kwh"),
    ]

    operations = [
        migrations.RunPython(remove_cmd_sigil_root, restore_cmd_sigil_root),
    ]
