# Generated by Django 2.1.7 on 2019-10-24 16:02

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('company', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PrdProps',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '产品属性列表',
                'verbose_name_plural': '产品属性列表',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='产品名称')),
                ('external_id', models.IntegerField(blank=True, null=True, unique=True, verbose_name='外部ID')),
                ('legacy_id', models.IntegerField(blank=True, null=True, verbose_name='内部ID')),
                ('external_code', models.CharField(blank=True, max_length=30, null=True, verbose_name='外部编码')),
                ('is_active', models.BooleanField(default=True, verbose_name='已激活')),
                ('is_delete', models.BooleanField(default=False, verbose_name='已删除')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('qty_x', models.SmallIntegerField(blank=True, default=0, null=True, verbose_name='单件箱数')),
                ('qty_h', models.SmallIntegerField(blank=True, default=0, null=True, verbose_name='单件盒数')),
                ('qty_p', models.SmallIntegerField(blank=True, default=0, null=True, verbose_name='单件瓶/支数')),
                ('ty_id', models.IntegerField(blank=True, null=True, unique=True, verbose_name='酒鬼透云ID')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='所属公司')),
            ],
            options={
                'verbose_name': '产品名称',
                'verbose_name_plural': '产品名称',
            },
        ),
        migrations.CreateModel(
            name='ProductProp',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(db_index=True, max_length=50, verbose_name='属性值')),
                ('categoryprop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.CategoryProp', verbose_name='产品属性')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '产品属性',
                'verbose_name_plural': '产品属性',
            },
        ),
        migrations.AddField(
            model_name='prdprops',
            name='prd_property',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.ProductProp', verbose_name='属性值'),
        ),
        migrations.AddField(
            model_name='prdprops',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='产品名称'),
        ),
        migrations.AlterUniqueTogether(
            name='productprop',
            unique_together={('company', 'categoryprop', 'value')},
        ),
        migrations.AlterUniqueTogether(
            name='prdprops',
            unique_together={('product', 'prd_property')},
        ),
    ]
