# Generated by Django 5.2.7 on 2025-12-12

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('stateflow', '0021_statelogparameterrecord'),
        ('printing', '0023_alter_printingjob_work_state'),
    ]

    operations = [
        migrations.CreateModel(
            name='PrintingJobBatchAdvanceRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                (
                    'parameters',
                    models.JSONField(
                        blank=True,
                        default=dict,
                        help_text='批量推进时提交的参数（与单条推进一致）',
                        verbose_name='工艺参数',
                    ),
                ),
                (
                    'created_by',
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name='printing_job_batch_advance_records',
                        to=settings.AUTH_USER_MODEL,
                        verbose_name='创建人',
                    ),
                ),
                (
                    'printing_order',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name='batch_advance_records',
                        to='printing.printingorder',
                        verbose_name='印染订单',
                    ),
                ),
                (
                    'state',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name='printing_job_batch_advance_records',
                        to='stateflow.state',
                        verbose_name='完成的流程节点',
                    ),
                ),
                (
                    'printing_jobs',
                    models.ManyToManyField(
                        related_name='batch_advance_records',
                        to='printing.printingjob',
                        verbose_name='印染明细',
                    ),
                ),
            ],
            options={
                'verbose_name': '印染任务批量推进记录',
                'verbose_name_plural': '印染任务批量推进记录',
            },
        ),
    ]


