# Generated by Django 3.0.7 on 2020-06-15 09: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', '0019_auto_20200612_1448'),
        ('certset', '0001_initial'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='implementrule',
            options={'verbose_name': '实施规则', 'verbose_name_plural': '实施规则'},
        ),
        migrations.AddField(
            model_name='implementrule',
            name='cert_pattern',
            field=models.ManyToManyField(blank=True, related_name='implementrule_cert_pattern', to='system.Dict', verbose_name='认证模式'),
        ),
        migrations.AddField(
            model_name='implementrule',
            name='cnas_scope',
            field=models.ManyToManyField(blank=True, related_name='implementrule_cnas_scope', to='system.Dict', verbose_name='CNAS业务范围'),
        ),
        migrations.AddField(
            model_name='implementrule',
            name='code',
            field=models.CharField(default='ok', max_length=30, unique=True, verbose_name='编号'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='implementrule',
            name='economy_class',
            field=models.ManyToManyField(blank=True, related_name='implementrule_economy_class', to='system.Dict', verbose_name='国民经济分类'),
        ),
        migrations.AddField(
            model_name='implementrule',
            name='name',
            field=models.CharField(default='ok', max_length=1000, verbose_name='规则名称'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='implementrule',
            name='pv_class',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='implementrule_pv_class', to='system.Dict', verbose_name='自愿性产品认证产品'),
        ),
        migrations.AddField(
            model_name='implementrule',
            name='pv_scope',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='implementrule_pv_scope', to='system.Dict', verbose_name='认证领域'),
        ),
        migrations.AddField(
            model_name='implementrule',
            name='standards',
            field=models.ManyToManyField(blank=True, related_name='implementrule_standards', to='certset.Standard', verbose_name='依据标准'),
        ),
        migrations.CreateModel(
            name='Unit',
            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='删除标记')),
                ('name', models.CharField(max_length=1000, verbose_name='单元名称')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='unit_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='unit_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '产品单元',
                'verbose_name_plural': '产品单元',
            },
        ),
        migrations.AddField(
            model_name='implementrule',
            name='units',
            field=models.ManyToManyField(blank=True, related_name='implementrule_units', to='certset.Unit', verbose_name='单元划分'),
        ),
    ]
