# Generated by Django 3.0.5 on 2021-04-12 06:07

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('system', '0016_auto_20210331_1040'),
        ('quality', '0002_inspecttask_inspectteam_subinspecttask'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='inspectteam',
            options={'verbose_name': '巡查组', 'verbose_name_plural': '巡查组'},
        ),
        migrations.AddField(
            model_name='subinspecttask',
            name='inspecttask',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='quality.InspectTask', verbose_name='所属任务'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='subinspecttask',
            name='leader',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='组长'),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='InspectRecord',
            fields=[
                ('id', models.AutoField(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='删除标记')),
                ('result', models.CharField(blank=True, choices=[('发现', '发现'), ('未发现', '未发现'), ('不适用', '不适用')], max_length=50, null=True, verbose_name='检查结果')),
                ('note', models.TextField(blank=True, null=True, verbose_name='检查说明')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inspectrecord_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('dept', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='system.Organization', verbose_name='受检查单位')),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quality.InspectItem', verbose_name='检查项')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inspectrecord_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '巡查记录',
                'verbose_name_plural': '巡查记录',
            },
        ),
        migrations.CreateModel(
            name='InspectDept',
            fields=[
                ('id', models.AutoField(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='删除标记')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inspectdept_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('dept', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='system.Organization', verbose_name='受巡查组织')),
                ('subtask', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quality.SubInspectTask', verbose_name='关联子任务')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inspectdept_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '巡查组',
                'verbose_name_plural': '巡查组',
            },
        ),
    ]
