# Generated by Django 2.0.4 on 2018-04-23 04:06

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_code', models.CharField(max_length=100, verbose_name='订单号')),
                ('address', models.TextField(verbose_name='收货地址')),
                ('post', models.CharField(max_length=100, verbose_name='邮政编码')),
                ('receiver', models.CharField(max_length=100, verbose_name='收货人信息')),
                ('mobile', models.CharField(max_length=11, verbose_name='手机号码')),
                ('user_msg', models.TextField(verbose_name='用户备注信息')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建日期')),
                ('pay_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='支付日期')),
                ('delivery_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='发货日期')),
                ('confirm_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='确认收货日期')),
                ('status', models.CharField(choices=[('waitPay', '等待支付'), ('waitDelivery', '等待发货'), ('waitConfirm', '等待收货'), ('finish', '交易完成'), ('delete', '订单删除')], default='waitPay', max_length=100, verbose_name='订单状态')),
                ('product_id', models.IntegerField(blank=True, null=True, verbose_name='产品id')),
                ('data_status', models.IntegerField(blank=True, default=1, verbose_name='数据状态')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='user.UserAccount', verbose_name='用户')),
            ],
            options={
                'verbose_name': '订单',
                'verbose_name_plural': '订单',
            },
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField(verbose_name='购买数量')),
                ('status', models.CharField(choices=[('default', '初始状态'), ('waitReview', '等待评价'), ('finish', '交易完成')], default='default', max_length=20, verbose_name='订单项状态')),
                ('order', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='operation.Order', verbose_name='订单')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='product.Product', verbose_name='产品')),
                ('user_account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='user.UserAccount', verbose_name='用户')),
            ],
            options={
                'verbose_name': '订单项',
                'verbose_name_plural': '订单项',
            },
        ),
    ]
