# Generated by Django 2.0.1 on 2019-07-05 09:55

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='YGAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address_details', models.CharField(max_length=500, verbose_name='收货地址')),
                ('addr_type', models.IntegerField(choices=[(0, '公司地址'), (1, '家庭地址')], default=0, verbose_name='地址类型')),
                ('phone_num', models.CharField(max_length=20, verbose_name='收件人电话')),
                ('name', models.CharField(max_length=20, verbose_name='收件人姓名')),
                ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.YGUser', verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '收货信息',
                'verbose_name_plural': '收货信息',
                'db_table': 'address',
            },
        ),
        migrations.CreateModel(
            name='YGCart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('c_goods_num', models.IntegerField(default=1, verbose_name='商品数量')),
                ('c_is_select', models.BooleanField(default=True, verbose_name='是否选中')),
                ('total_price', models.FloatField(default=0.0, verbose_name='总价格')),
                ('c_goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.YGGoods', verbose_name='商品ID')),
                ('c_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.YGUser', verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '购物车',
                'verbose_name_plural': '购物车',
                'db_table': 'cart',
            },
        ),
        migrations.CreateModel(
            name='YGComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comments', models.CharField(max_length=500, verbose_name='用户评论')),
            ],
            options={
                'verbose_name': '用户评论',
                'verbose_name_plural': '用户评论',
                'db_table': 'comments',
            },
        ),
        migrations.CreateModel(
            name='YGOderDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('o_goods_num', models.IntegerField(default=1, verbose_name='商品数量')),
                ('o_goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.YGGoods', verbose_name='商品ID')),
            ],
            options={
                'verbose_name': '订单详情',
                'verbose_name_plural': '订单详情',
                'db_table': 'orderdetail',
            },
        ),
        migrations.CreateModel(
            name='YGOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('o_price', models.FloatField(verbose_name='总价格')),
                ('o_time', models.DateTimeField(auto_now=True, verbose_name='下单时间')),
                ('o_status', models.CharField(choices=[(0, '已下单未付款'), (1, '已下单已付款待收货'), (2, '下单后待评论')], default=0, max_length=20, verbose_name='订单状态')),
                ('addr_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order.YGAddress', verbose_name='收货地址id')),
                ('o_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.YGUser', verbose_name='用户ID')),
            ],
            options={
                'verbose_name': '订单',
                'verbose_name_plural': '订单',
                'db_table': 'orders',
            },
        ),
        migrations.AddField(
            model_name='ygoderdetail',
            name='o_order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order.YGOrder', verbose_name='订单ID'),
        ),
        migrations.AddField(
            model_name='ygcomment',
            name='order_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order.YGOrder', verbose_name='订单ID'),
        ),
        migrations.AddField(
            model_name='ygcomment',
            name='user_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.YGUser', verbose_name='用户ID'),
        ),
    ]
