# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-24 13:28
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(db_column='cid', primary_key=True, serialize=False, verbose_name='购物车添加商品编号')),
                ('num', models.IntegerField(db_column='cnum', verbose_name='购物车商品数量')),
                ('is_selected', models.BooleanField(db_column='is_selected', default=True, verbose_name='是否选中商品')),
            ],
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(db_column='gid', primary_key=True, serialize=False, verbose_name='商品编号')),
                ('name', models.CharField(db_column='gname', max_length=20, verbose_name='商品名称')),
                ('img', models.ImageField(db_column='gimg', upload_to='media', verbose_name='商品图片')),
                ('price', models.DecimalField(db_column='gprice', decimal_places=2, max_digits=5, verbose_name='商品单价')),
                ('is_deleted', models.BooleanField(db_column='is_deleted', default=False, verbose_name='商品是否从购物车中删除')),
                ('unit', models.CharField(db_column='gunit', default='500g', max_length=20, verbose_name='商品计量单位')),
                ('inventory', models.IntegerField(db_column='ginventory', default='999', verbose_name='商品存量')),
                ('detail', models.CharField(db_column='gdetail', max_length=1000, verbose_name='商品详细介绍')),
            ],
        ),
        migrations.CreateModel(
            name='GoodsType',
            fields=[
                ('id', models.AutoField(db_column='tid', primary_key=True, serialize=False, verbose_name='商品类型编号')),
                ('name', models.CharField(db_column='tname', max_length=20, verbose_name='商品类型名称')),
                ('is_deleted', models.BooleanField(db_column='is_deleted', default=False, verbose_name='是否删除该分类')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(db_column='oid', primary_key=True, serialize=False, verbose_name='订单编号')),
                ('date', models.DateTimeField(auto_now=True, db_column='otime', verbose_name='下单时间')),
                ('total', models.DecimalField(db_column='total', decimal_places=2, max_digits=6, verbose_name='商品总金额')),
                ('freight', models.DecimalField(db_column='freight', decimal_places=2, max_digits=6, verbose_name='运费')),
                ('is_payed', models.BooleanField(db_column='is_payed', default=False, verbose_name='是否已支付')),
                ('receive_detail', models.ForeignKey(db_column='receive', on_delete=django.db.models.deletion.CASCADE, to='user.ReceiveDetail', verbose_name='接收人详情')),
                ('user', models.ForeignKey(db_column='uid', on_delete=django.db.models.deletion.CASCADE, to='user.User', verbose_name='下单用户')),
            ],
        ),
        migrations.AddField(
            model_name='goods',
            name='goodstype',
            field=models.ForeignKey(db_column='tid', on_delete=django.db.models.deletion.CASCADE, to='app01.GoodsType', verbose_name='商品归属类型'),
        ),
        migrations.AddField(
            model_name='cart',
            name='goods',
            field=models.ForeignKey(db_column='gid', on_delete=django.db.models.deletion.CASCADE, to='app01.Goods', verbose_name='关联商品id'),
        ),
        migrations.AddField(
            model_name='cart',
            name='user',
            field=models.ForeignKey(db_column='uid', on_delete=django.db.models.deletion.CASCADE, to='user.User', verbose_name='购物车用户id'),
        ),
    ]
