# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-24 22:25
from __future__ import unicode_literals

import ckeditor_uploader.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('title', models.CharField(max_length=150, verbose_name='活动名称')),
                ('img_url', models.ImageField(upload_to='activity/%y%m/%d', verbose_name='活动图片地址')),
                ('url_site', models.URLField(verbose_name='活动的url地址')),
            ],
            options={
                'verbose_name': '首页活动管理',
                'verbose_name_plural': '首页活动管理',
                'db_table': 'Activity',
            },
        ),
        migrations.CreateModel(
            name='ActivityZone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('title', models.CharField(max_length=150, verbose_name='活动专区名称')),
                ('brief', models.CharField(blank=True, max_length=200, null=True, verbose_name='活动专区的简介')),
                ('order', models.SmallIntegerField(default=0, verbose_name='排序')),
                ('shelves', models.BooleanField(choices=[(False, '下架'), (True, '上架')], default=0, verbose_name='上否上线')),
            ],
            options={
                'verbose_name': '活动专区管理',
                'verbose_name_plural': '活动专区管理',
                'db_table': 'ActivityZone',
            },
        ),
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('name', models.CharField(max_length=150, verbose_name='轮播活动名')),
                ('img_url', models.ImageField(upload_to='banner/%y%m/%d', verbose_name='轮播图片地址')),
                ('order', models.SmallIntegerField(default=0, verbose_name='排序')),
            ],
            options={
                'verbose_name': '首页轮播商品表',
                'verbose_name_plural': '首页轮播商品表',
                'db_table': 'Banner',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('cate_name', models.CharField(max_length=50, validators=[django.core.validators.MinLengthValidator(2)], verbose_name='分类名称')),
                ('brief', models.CharField(blank=True, max_length=200, null=True, verbose_name='描述')),
                ('order', models.SmallIntegerField(default=0, verbose_name='排序')),
            ],
            options={
                'verbose_name': '商品分类表',
                'verbose_name_plural': '商品分类表',
                'db_table': 'Category',
            },
        ),
        migrations.CreateModel(
            name='Gallery',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('img_url', models.ImageField(upload_to='goods/%y%m/%d', verbose_name='相册图片地址')),
            ],
            options={
                'verbose_name': '商品相册表',
                'verbose_name_plural': '商品相册表',
                'db_table': 'Gallery',
            },
        ),
        migrations.CreateModel(
            name='GoodsSKU',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('sku_name', models.CharField(max_length=100, validators=[django.core.validators.MinLengthValidator(2)], verbose_name='商品SKU名称')),
                ('brief', models.CharField(blank=True, max_length=200, null=True, verbose_name='商品简介')),
                ('price', models.DecimalField(decimal_places=4, max_digits=10, verbose_name='价格')),
                ('stock', models.IntegerField(default=0, verbose_name='库存')),
                ('sale_num', models.IntegerField(default=0, verbose_name='销量')),
                ('logo', models.ImageField(upload_to='goods/%y%m/%d', verbose_name='商品logo')),
                ('shelves', models.BooleanField(choices=[(False, '下架'), (True, '上架')], default=False, verbose_name='是否上架')),
            ],
            options={
                'verbose_name': '商品SKU表',
                'verbose_name_plural': '商品SKU表',
                'db_table': 'GoodsSKU',
            },
        ),
        migrations.CreateModel(
            name='GoodsSPU',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('spu_name', models.CharField(max_length=50, validators=[django.core.validators.MinLengthValidator(2)], verbose_name='商品SPU名称')),
                ('content', ckeditor_uploader.fields.RichTextUploadingField(validators=[django.core.validators.MinLengthValidator(2)], verbose_name='商品spu详情')),
            ],
            options={
                'verbose_name': '商品SPU表',
                'verbose_name_plural': '商品SPU表',
                'db_table': 'GoodsSPU',
            },
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_delete', models.BooleanField(default=False)),
                ('Create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('unitname', models.CharField(max_length=10, verbose_name='单位名')),
            ],
            options={
                'verbose_name': '商品单位表',
                'verbose_name_plural': '商品单位表',
                'db_table': 'Unit',
            },
        ),
        migrations.AddField(
            model_name='goodssku',
            name='goods_spu',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSPU', verbose_name='商品SPU'),
        ),
        migrations.AddField(
            model_name='goodssku',
            name='is_on_sale',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Category', verbose_name='商品分类'),
        ),
        migrations.AddField(
            model_name='goodssku',
            name='unit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Unit', verbose_name='单位'),
        ),
        migrations.AddField(
            model_name='gallery',
            name='goods_sku',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU', verbose_name='商品SKU'),
        ),
        migrations.AddField(
            model_name='banner',
            name='goods_sku',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU', verbose_name='商品SKU'),
        ),
        migrations.AddField(
            model_name='activityzone',
            name='goods_sku',
            field=models.ManyToManyField(to='goods.GoodsSKU', verbose_name='商品'),
        ),
    ]
