# Generated by Django 3.2.6 on 2021-10-12 01:01

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


class Migration(migrations.Migration):

    dependencies = [
        ('mtm', '0018_material_count'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubProduction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, 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='删除标记')),
                ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='命名')),
                ('sort', models.IntegerField(default=1, verbose_name='排序号')),
            ],
            options={
                'verbose_name': '产品生产工序',
                'verbose_name_plural': '产品生产工序',
            },
        ),
        migrations.RemoveField(
            model_name='inputmaterial',
            name='create_by',
        ),
        migrations.RemoveField(
            model_name='inputmaterial',
            name='process',
        ),
        migrations.RemoveField(
            model_name='inputmaterial',
            name='product',
        ),
        migrations.RemoveField(
            model_name='inputmaterial',
            name='update_by',
        ),
        migrations.RemoveField(
            model_name='material',
            name='processes',
        ),
        migrations.RemoveField(
            model_name='outputmaterial',
            name='create_by',
        ),
        migrations.RemoveField(
            model_name='outputmaterial',
            name='process',
        ),
        migrations.RemoveField(
            model_name='outputmaterial',
            name='product',
        ),
        migrations.RemoveField(
            model_name='outputmaterial',
            name='update_by',
        ),
        migrations.RemoveField(
            model_name='techdoc',
            name='create_by',
        ),
        migrations.RemoveField(
            model_name='techdoc',
            name='process',
        ),
        migrations.RemoveField(
            model_name='techdoc',
            name='product',
        ),
        migrations.RemoveField(
            model_name='techdoc',
            name='update_by',
        ),
        migrations.RemoveField(
            model_name='usedstep',
            name='create_by',
        ),
        migrations.RemoveField(
            model_name='usedstep',
            name='process',
        ),
        migrations.RemoveField(
            model_name='usedstep',
            name='product',
        ),
        migrations.RemoveField(
            model_name='usedstep',
            name='update_by',
        ),
        migrations.AddField(
            model_name='usedstep',
            name='remark',
            field=models.TextField(blank=True, null=True, verbose_name='生产备注'),
        ),
        migrations.AlterField(
            model_name='step',
            name='process',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='step_process', to='mtm.process', verbose_name='所属工序'),
        ),
        migrations.AddField(
            model_name='subproduction',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mtm.material', verbose_name='产品'),
        ),
        migrations.AddField(
            model_name='inputmaterial',
            name='subproduction',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='mtm.subproduction', verbose_name='关联生产分解'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='outputmaterial',
            name='subproduction',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='mtm.subproduction', verbose_name='关联生产分解'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='techdoc',
            name='subproduction',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='mtm.subproduction', verbose_name='关联生产分解'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='usedstep',
            name='subproduction',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='mtm.subproduction', verbose_name='关联生产分解'),
            preserve_default=False,
        ),
    ]
