# Generated by Django 2.2.5 on 2019-09-14 13:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AvailableSpec',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
            ],
            options={
                'verbose_name': '可售规格记录',
                'verbose_name_plural': '可售规格记录',
                'db_table': 't_available_specs',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('name', models.CharField(max_length=30, verbose_name='名称')),
                ('letter', models.CharField(blank=True, max_length=30, null=True, verbose_name='名称拼写')),
                ('desc', models.TextField(blank=True, null=True, verbose_name='描述')),
                ('slogan', models.CharField(blank=True, max_length=80, null=True, verbose_name='标语')),
                ('bg_color', models.CharField(blank=True, max_length=30, null=True, verbose_name='背景色')),
                ('is_recommended', models.BooleanField(default=False, verbose_name='是否首页推荐')),
            ],
            options={
                'verbose_name': '品牌',
                'verbose_name_plural': '品牌',
                'db_table': 't_brands',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('name', models.CharField(default='', max_length=30, verbose_name='分类名称')),
                ('vice_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='分类副标题')),
                ('slogan', models.CharField(blank=True, max_length=100, null=True, verbose_name='分类标语')),
                ('bg_color', models.CharField(blank=True, max_length=10, null=True, verbose_name='分类背景色')),
                ('is_recommended', models.BooleanField(default=False, verbose_name='是否首页推荐')),
            ],
            options={
                'verbose_name': '商品分类',
                'verbose_name_plural': '商品分类',
                'db_table': 't_categories',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='InteractedProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('type', models.CharField(choices=[('like', '点赞'), ('fav', '收藏'), ('watched', '看过')], max_length=20, verbose_name='行为')),
            ],
            options={
                'verbose_name': '互动商品记录',
                'verbose_name_plural': '互动商品记录',
                'db_table': 't_interacted_products',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='InventoryHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('change', models.IntegerField(default=0, verbose_name='变化数量')),
                ('current_inventory', models.IntegerField(default=0, verbose_name='变化后')),
                ('message', models.CharField(default='', max_length=200, verbose_name='变更原因')),
                ('note', models.TextField(default='', verbose_name='库存变更备注')),
            ],
            options={
                'verbose_name': '库存变化记录',
                'verbose_name_plural': '库存变化记录',
                'db_table': 't_inventory_histories',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('name', models.CharField(max_length=80, verbose_name='产品名称')),
                ('item_no', models.CharField(blank=True, default='', max_length=30, null=True, verbose_name='货号')),
                ('brief', models.CharField(blank=True, max_length=160, null=True, verbose_name='产品简述')),
                ('desc', extra_apps.DjangoUeditor.models.UEditorField(blank=True, default='', null=True, verbose_name='详情')),
                ('is_id_needed', models.BooleanField(default=False, verbose_name='是否需要ID')),
                ('access_count', models.IntegerField(default=0, verbose_name='浏览次数')),
                ('like_count', models.IntegerField(default=0, verbose_name='点赞次数')),
                ('favorite_count', models.IntegerField(default=0, verbose_name='收藏次数')),
                ('is_recommended', models.BooleanField(default=False, verbose_name='是否首页推荐')),
                ('is_new', models.BooleanField(default=False, verbose_name='是否新品')),
                ('is_hot', models.BooleanField(default=False, verbose_name='是否热销')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
                'db_table': 't_products',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='Spec',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('name', models.CharField(max_length=30, verbose_name='规格名称')),
                ('value', models.CharField(max_length=30, verbose_name='规格值')),
                ('is_free_shipping', models.BooleanField(default=True, verbose_name='是否包邮')),
                ('parent', models.ForeignKey(db_column='pid', on_delete=django.db.models.deletion.CASCADE, related_name='children', to='product.Spec', verbose_name='父级规格')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='specs', to='product.Product', verbose_name='所属产品')),
            ],
            options={
                'verbose_name': '商品规格',
                'verbose_name_plural': '商品规格',
                'db_table': 't_specs',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='SpecDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('note', models.CharField(blank=True, max_length=160, null=True, verbose_name='规格说明')),
                ('gross_weight', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='毛重(g)')),
                ('length', models.IntegerField(blank=True, default=0, null=True, verbose_name='长(mm)')),
                ('height', models.IntegerField(blank=True, default=0, null=True, verbose_name='高(mm)')),
                ('width', models.IntegerField(blank=True, default=0, null=True, verbose_name='宽(mm)')),
                ('sku', models.CharField(blank=True, default='', max_length=80, null=True, verbose_name='规格编码')),
                ('barcode', models.CharField(blank=True, default='', max_length=80, null=True, verbose_name='条形码')),
                ('min_quantity', models.IntegerField(default=0, verbose_name='最小可购买数量')),
                ('max_quantity', models.IntegerField(default=0, verbose_name='最大可购买数量')),
                ('inventory', models.IntegerField(default=0, verbose_name='库存数量')),
                ('is_deduction_inventory', models.BooleanField(default=False, verbose_name='是否扣减库存')),
                ('spec', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='detail', to='product.Spec', verbose_name='所属产品')),
            ],
            options={
                'verbose_name': '规格详情',
                'verbose_name_plural': '规格详情',
                'db_table': 't_spec_details',
                'ordering': ('-sort', '-add_time'),
            },
        ),
        migrations.CreateModel(
            name='ProductSalesType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort', models.PositiveIntegerField(default=0, verbose_name='排序优先级')),
                ('is_enable', models.BooleanField(default=True, verbose_name='是否启用')),
                ('is_delete', models.BooleanField(default=True, verbose_name='是否删除')),
                ('delete_time', models.DateTimeField(blank=True, default=0, null=True, verbose_name='删除时间')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('extends', models.TextField(blank=True, null=True, verbose_name='扩展数据(json格式存储)')),
                ('type', models.CharField(choices=[('wr', '供货和零售'), ('w', '只供货'), ('r', '只零售')], max_length=20, verbose_name='行为')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sales', to='product.Product', verbose_name='相关商品')),
            ],
            options={
                'verbose_name': '用户商品销售模式',
                'verbose_name_plural': '用户商品销售模式',
                'db_table': 't_sales_types',
                'ordering': ('-add_time',),
            },
        ),
    ]
