# Generated by Django 5.2.15 on 2026-06-17 19:45

from django.db import migrations, models


def seed_builtins(apps, schema_editor):
    from fitcheck.services.policies import seed_builtin_policies

    CompliancePolicy = apps.get_model("fitcheck", "CompliancePolicy")
    PolicySlotRule = apps.get_model("fitcheck", "PolicySlotRule")
    seed_builtin_policies(CompliancePolicy, PolicySlotRule)


def unseed_builtins(apps, schema_editor):
    CompliancePolicy = apps.get_model("fitcheck", "CompliancePolicy")
    CompliancePolicy.objects.filter(is_builtin=True).delete()


class Migration(migrations.Migration):

    dependencies = [
        ('fitcheck', '0021_doctrinefit_feb_frigate_type_id_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='compliancepolicy',
            name='is_builtin',
            field=models.BooleanField(default=False),
        ),
        migrations.RunPython(seed_builtins, unseed_builtins),
    ]
