# Generated by Django 3.0 on 2019-12-06 16:17

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '购物车',
            },
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=30, verbose_name='标签')),
                ('name', models.CharField(max_length=30, verbose_name='描述')),
            ],
            options={
                'verbose_name': '商品分类',
            },
        ),
        migrations.CreateModel(
            name='Good',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='标题')),
                ('price', models.FloatField(verbose_name='价格')),
                ('collections', models.ManyToManyField(to='order.Collection')),
            ],
            options={
                'verbose_name': '商品',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cash', models.FloatField(verbose_name='总价')),
                ('amount', models.PositiveIntegerField(verbose_name='数量')),
                ('status', models.CharField(choices=[('SUMMIT', '提交'), ('PAY', '已付款'), ('SHIP', '运送中'), ('COMPLETE', '完成'), ('CANCEL', '交易关闭')], default='SUMMIT', max_length=10, verbose_name='订单状态')),
                ('address', models.CharField(max_length=100, verbose_name='地址')),
                ('express_number', models.CharField(max_length=32, null=True, verbose_name='快递单号')),
                ('express_cmp', models.CharField(max_length=32, null=True, verbose_name='快递公司')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='订单创建时间')),
                ('pay_time', models.DateTimeField(null=True, verbose_name='订单付款时间')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '订单',
            },
        ),
        migrations.CreateModel(
            name='TestImageUpload',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(upload_to='img')),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveIntegerField(verbose_name='数量')),
                ('size', models.CharField(max_length=4, verbose_name='码数')),
                ('good', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='order.Good', verbose_name='商品')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='order.Order', verbose_name='订单')),
            ],
            options={
                'verbose_name': '订单项目',
            },
        ),
        migrations.CreateModel(
            name='GoodSize',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('size', models.CharField(max_length=5, verbose_name='码数')),
                ('amount', models.PositiveIntegerField(default=0, verbose_name='存量')),
                ('good', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='order.Good', verbose_name='商品')),
            ],
        ),
        migrations.CreateModel(
            name='CartItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveIntegerField(verbose_name='数量')),
                ('size', models.CharField(max_length=4, verbose_name='码数')),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='order.Cart', verbose_name='购物车')),
                ('good', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='order.Good', verbose_name='商品')),
            ],
            options={
                'verbose_name': '购物车项目',
            },
        ),
    ]
