# Generated by Django 6.0 on 2026-01-09

from django.db import migrations, models
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps


def forwards(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
    DBTaskResult = apps.get_model("django_tasks_database", "DBTaskResult")
    DBTaskResult.objects.using(schema_editor.connection.alias).filter(
        status="SUCCEEDED"
    ).update(status="SUCCESSFUL")


def backwards(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
    DBTaskResult = apps.get_model("django_tasks_database", "DBTaskResult")
    DBTaskResult.objects.using(schema_editor.connection.alias).filter(
        status="SUCCESSFUL"
    ).update(status="SUCCEEDED")


class Migration(migrations.Migration):
    dependencies = [
        ("django_tasks_database", "0017_dbtaskresult_metadata"),
    ]

    operations = [
        migrations.AlterField(
            model_name="dbtaskresult",
            name="status",
            field=models.CharField(
                choices=[
                    ("READY", "Ready"),
                    ("RUNNING", "Running"),
                    ("FAILED", "Failed"),
                    ("SUCCESSFUL", "Successful"),
                ],
                default="READY",
                max_length=10,
                verbose_name="status",
            ),
        ),
        migrations.RunPython(forwards, backwards),
    ]
