# Generated by GPT-5.2-Codex-Max on 2025-02-14

from __future__ import annotations

from django.db import migrations, models


def restore_sigil_roots(apps, schema_editor):
    SigilRoot = apps.get_model("sigils", "SigilRoot")
    manager = getattr(SigilRoot, "all_objects", SigilRoot._base_manager)
    (
        manager.using(schema_editor.connection.alias)
        .filter(is_deleted=True)
        .update(is_deleted=False)
    )


class Migration(migrations.Migration):

    dependencies = [
        ("sigils", "0003_seed_sigil_roots"),
    ]

    operations = [
        migrations.RunPython(restore_sigil_roots, migrations.RunPython.noop),
        migrations.AddConstraint(
            model_name="sigilroot",
            constraint=models.CheckConstraint(
                condition=models.Q(is_deleted=False),
                name="sigilroot_is_deleted_false",
            ),
        ),
    ]
