# Generated by Django 4.2.29 on 2026-03-25 10:52

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("incidents", "0030_add_mitigated_at_field"),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name="incident",
            name="incidents_incident_closure_reason_valid",
        ),
        migrations.AddConstraint(
            model_name="incident",
            constraint=models.CheckConstraint(
                check=models.Q(
                    (
                        "closure_reason__in",
                        [
                            "resolved",
                            "duplicate",
                            "false_positive",
                            "superseded",
                            "external",
                            "cancelled",
                            "",
                        ],
                    ),
                    ("closure_reason__isnull", True),
                    _connector="OR",
                ),
                name="incidents_incident_closure_reason_valid",
            ),
        ),
    ]
