# Generated by Django 3.2.12 on 2025-03-21 06:14

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('inm', '0029_alter_mioitem_batch'),
        ('wpm', '0100_auto_20250317_0955'),
    ]

    operations = [
        migrations.AddField(
            model_name='batchst',
            name='handover',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wpm.handover', verbose_name='由何交接记录创建'),
        ),
        migrations.AddField(
            model_name='batchst',
            name='mio',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='inm.mio', verbose_name='由何出入库记录创建'),
        ),
        migrations.AddField(
            model_name='batchst',
            name='mlog',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wpm.mlog', verbose_name='由何日志创建'),
        ),
        migrations.AlterField(
            model_name='batchst',
            name='batch',
            field=models.TextField(db_index=True, unique=True, verbose_name='批次号'),
        ),
        migrations.CreateModel(
            name='BatchLog',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('source_b', models.TextField(db_index=True, verbose_name='来源批次')),
                ('target_b', models.TextField(db_index=True, verbose_name='目标批次')),
                ('relation_type', models.CharField(default='split', help_text='split/merge', max_length=20, verbose_name='关联类型')),
                ('handover', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wpm.handover', verbose_name='关联交接记录')),
                ('mlog', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wpm.mlog', verbose_name='关联生产记录')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
