# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-12-07 15:11
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(max_length=200, upload_to='goods/banner/images', verbose_name='图片')),
                ('index', models.IntegerField(default=0, verbose_name='轮播顺序')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '首页轮播图',
                'verbose_name_plural': '首页轮播图',
            },
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('goods_sn', models.CharField(default='', max_length=30, verbose_name='商品货号')),
                ('name', models.CharField(max_length=60, verbose_name='商品名')),
                ('click_num', models.IntegerField(default=0, verbose_name='点击量')),
                ('sold_num', models.IntegerField(default=0, verbose_name='销售量')),
                ('fav_num', models.IntegerField(default=0, verbose_name='收藏量')),
                ('goods_num', models.IntegerField(default=0, verbose_name='库存量')),
                ('maket_price', models.FloatField(default=0, verbose_name='市场价')),
                ('shop_price', models.FloatField(default=0, verbose_name='本店价')),
                ('goods_brief', models.TextField(max_length=500, verbose_name='商品简短简介')),
                ('goods_desc', DjangoUeditor.models.UEditorField(default='', verbose_name='内容')),
                ('ship_free', models.BooleanField(default=False, verbose_name='是否承担运费')),
                ('goods_front_image', models.ImageField(blank=True, null=True, upload_to='goods/images/', verbose_name='商品封面图')),
                ('is_new', models.BooleanField(default=False, verbose_name='是否新品')),
                ('is_hot', models.BooleanField(default=False, verbose_name='是否热卖')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=30, verbose_name='分类名')),
                ('code', models.CharField(default='', max_length=30, verbose_name='分类编号')),
                ('desc', models.CharField(default='', max_length=100, verbose_name='分类描述')),
                ('category_type', models.CharField(choices=[(1, '一级类目'), (2, '二级类目'), (3, '三级类目')], max_length=100, verbose_name='分类所属级别')),
                ('is_table', models.BooleanField(default=False, verbose_name='是否在导航栏')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('parent_category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sub_cat', to='mx_goods.GoodsCategory', verbose_name='当前分类的父类')),
            ],
            options={
                'verbose_name': '商品类别',
                'verbose_name_plural': '商品类别',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategoryBrand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=40, verbose_name='品牌名')),
                ('desc', models.CharField(default='', max_length=100, verbose_name='品牌简介')),
                ('image', models.ImageField(max_length=200, upload_to='brands/')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='brands', to='mx_goods.GoodsCategory', verbose_name='所属分类')),
            ],
            options={
                'verbose_name': '品牌',
                'verbose_name_plural': '品牌',
            },
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(max_length=200, upload_to='goods/lun/images/', verbose_name='图片')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='good_images', to='mx_goods.Goods', verbose_name='商品')),
            ],
            options={
                'verbose_name': '商品详细页轮播图',
                'verbose_name_plural': '商品详细页轮播图',
            },
        ),
        migrations.CreateModel(
            name='HotSearch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('keywords', models.CharField(default='', max_length=50, verbose_name='热搜词')),
                ('index', models.IntegerField(default=0, verbose_name='显示顺序')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '热搜词',
                'verbose_name_plural': '热搜词',
            },
        ),
        migrations.AddField(
            model_name='goods',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mx_goods.GoodsCategory', verbose_name='商品所在类别'),
        ),
        migrations.AddField(
            model_name='banner',
            name='goods',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='banner', to='mx_goods.Goods', verbose_name='商品'),
        ),
    ]
