# Generated by Django 4.2.10 on 2024-04-02 12:18

from django.db import migrations, models


def update_project_state_group(apps, schema_editor):
    State = apps.get_model("db", "State")

    # Update states in bulk
    State.objects.filter(group="backlog", name="Triage").update(
        is_triage=True, group="triage"
    )


class Migration(migrations.Migration):

    dependencies = [
        ("db", "0062_cycle_archived_at_module_archived_at_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="state",
            name="is_triage",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name="state",
            name="group",
            field=models.CharField(
                choices=[
                    ("backlog", "Backlog"),
                    ("unstarted", "Unstarted"),
                    ("started", "Started"),
                    ("completed", "Completed"),
                    ("cancelled", "Cancelled"),
                    ("triage", "Triage"),
                ],
                default="backlog",
                max_length=20,
            ),
        ),
        migrations.RunPython(update_project_state_group),
    ]
