# Generated by Plain 0.63.0 on 2025-09-15 21:29

from plain import postgres
from plain.postgres import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("plainjobs", "0002_job_span_id_job_trace_id_jobrequest_span_id_and_more"),
    ]

    operations = [
        migrations.RenameModel(
            old_name="Job",
            new_name="JobProcess",
        ),
        migrations.RemoveIndex(
            model_name="jobresult",
            name="plainworker_job_uui_8307d1_idx",
        ),
        migrations.RenameField(
            model_name="jobresult",
            old_name="job_uuid",
            new_name="job_process_uuid",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_created_0d3928_idx",
            old_name="plainworker_created_a02317_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_queue_2550ba_idx",
            old_name="plainworker_queue_077806_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_unique__9dc0bb_idx",
            old_name="plainworker_unique__04d87b_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_started_b80ec5_idx",
            old_name="plainworker_started_143df5_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_job_cla_fe2b70_idx",
            old_name="plainworker_job_cla_884b46_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_job_req_357898_idx",
            old_name="plainworker_job_req_db2681_idx",
        ),
        migrations.RenameIndex(
            model_name="jobprocess",
            new_name="plainworker_trace_i_da2cfa_idx",
            old_name="plainworker_trace_i_d2b645_idx",
        ),
        migrations.AddIndex(
            model_name="jobresult",
            index=postgres.Index(
                fields=["job_process_uuid"], name="plainworker_job_pro_ceabfb_idx"
            ),
        ),
        # To fix subsequent migrations...
        migrations.AlterModelTable(
            name="JobRequest",
            table="plainworker_jobrequest",
        ),
        migrations.AlterModelTable(
            name="JobProcess",
            table="plainworker_jobprocess",
        ),
        migrations.AlterModelTable(
            name="JobResult",
            table="plainworker_jobresult",
        ),
    ]
