# Generated by Django 2.1.5 on 2019-03-12 01:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='GoodImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('images', models.ImageField(upload_to='image', verbose_name='商品图片')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GoodSku',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(max_length=20, verbose_name='商品名称')),
                ('desc', models.CharField(max_length=256, verbose_name='商品简介')),
                ('price', models.FloatField(verbose_name='商品价格')),
                ('unit', models.CharField(max_length=5, verbose_name='商品单位')),
                ('inventory', models.IntegerField(verbose_name='库存数量')),
                ('sales_num', models.IntegerField(verbose_name='销售数量')),
                ('image', models.ImageField(upload_to='goods', verbose_name='商品图片')),
                ('status', models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')], default=1, verbose_name='商品状态')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GoodSpu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(max_length=20, verbose_name='商品名称')),
                ('detail', tinymce.models.HTMLField(verbose_name='商品详情')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GoodsType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(max_length=20, verbose_name='种类名称')),
                ('logo', models.CharField(max_length=20, verbose_name='logo标识')),
                ('image', models.ImageField(upload_to='type', verbose_name='商品类型图片')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='IndexBanner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(max_length=20, verbose_name='活动名称')),
                ('image', models.ImageField(upload_to='banner', verbose_name='banner图')),
                ('activity_url', models.URLField(verbose_name='活动链接')),
                ('index', models.SmallIntegerField(verbose_name='位置ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='IndexCarousel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('image', models.ImageField(upload_to='carousel', verbose_name='轮播图片')),
                ('index', models.SmallIntegerField(verbose_name='位置ID')),
                ('sku_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodSku')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='IndexGoods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('display_type', models.SmallIntegerField(choices=[(0, '图片'), (1, '文字')], default=0, verbose_name='展示方式')),
                ('index', models.SmallIntegerField(verbose_name='位置ID')),
                ('sku_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodSku')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsType', verbose_name='商品类型')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='goodsku',
            name='good_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsType', verbose_name='商品种类'),
        ),
        migrations.AddField(
            model_name='goodsku',
            name='spu_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodSpu'),
        ),
        migrations.AddField(
            model_name='goodimage',
            name='sku_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodSku'),
        ),
    ]
