# Generated by Django 3.0.6 on 2020-05-05 14:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('address_id', models.AutoField(primary_key=True, serialize=False)),
                ('d_address', models.CharField(max_length=60, verbose_name='地址')),
                ('d_name', models.CharField(max_length=20, verbose_name='收货人')),
                ('d_tel', models.CharField(max_length=20, verbose_name='收货电话')),
            ],
            options={
                'verbose_name_plural': '地址信息管理',
                'db_table': 'address',
            },
        ),
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('cart_id', models.AutoField(primary_key=True, serialize=False)),
                ('cart_total_price', models.FloatField()),
            ],
            options={
                'verbose_name_plural': '购物车管理',
                'db_table': 'cart',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('product_id', models.AutoField(primary_key=True, serialize=False)),
                ('storage', models.IntegerField()),
                ('product_name', models.CharField(max_length=255)),
                ('detail', models.TextField()),
                ('last_update', models.DateTimeField()),
                ('product_price', models.FloatField()),
            ],
            options={
                'verbose_name_plural': '商品管理',
                'db_table': 'product',
            },
        ),
        migrations.CreateModel(
            name='ProductCatagory',
            fields=[
                ('catagory_id', models.AutoField(primary_key=True, serialize=False)),
                ('catogary', models.CharField(max_length=20)),
            ],
            options={
                'verbose_name_plural': '商品类型管理',
                'db_table': 'product_catagory',
            },
        ),
        migrations.CreateModel(
            name='UserLogin',
            fields=[
                ('user_id', models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=20, unique=True, verbose_name='用户名')),
                ('password', models.CharField(max_length=255, verbose_name='密码')),
                ('acive', models.BooleanField()),
            ],
            options={
                'verbose_name_plural': '用户管理',
                'db_table': 'user_login',
            },
        ),
        migrations.CreateModel(
            name='Userinfo',
            fields=[
                ('email', models.CharField(max_length=30, verbose_name='电子邮件')),
                ('u_phone', models.CharField(max_length=20, verbose_name='电话号码')),
                ('register_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('birthdate', models.DateField(default=datetime.date(2020, 5, 5))),
                ('level', models.IntegerField(default=1)),
                ('info_id', models.AutoField(primary_key=True, serialize=False)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mall.UserLogin')),
            ],
            options={
                'db_table': 'userinfo',
            },
        ),
        migrations.CreateModel(
            name='ProductPicture',
            fields=[
                ('pict_id', models.AutoField(primary_key=True, serialize=False)),
                ('purl', models.CharField(max_length=255)),
                ('main_pict', models.IntegerField()),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Product')),
            ],
            options={
                'verbose_name_plural': '商品图片管理',
                'db_table': 'product_picture',
            },
        ),
        migrations.AddField(
            model_name='product',
            name='catagory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.ProductCatagory'),
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('order_id', models.AutoField(primary_key=True, serialize=False)),
                ('order_status', models.IntegerField()),
                ('delivery_company', models.CharField(max_length=255)),
                ('delivery_id', models.IntegerField()),
                ('payment_time', models.DateTimeField()),
                ('send_time', models.DateTimeField()),
                ('finish_time', models.DateTimeField()),
                ('last_update_time', models.DateTimeField()),
                ('total_money', models.FloatField()),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Address')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.UserLogin')),
            ],
            options={
                'verbose_name_plural': '订单管理',
                'db_table': 'orders',
            },
        ),
        migrations.CreateModel(
            name='CartInclude',
            fields=[
                ('entry_id', models.AutoField(primary_key=True, serialize=False)),
                ('add_time', models.DateTimeField(default=datetime.datetime(2020, 5, 5, 14, 30, 29, 907134, tzinfo=utc))),
                ('num_items', models.IntegerField(default=1)),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Cart')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Product')),
            ],
            options={
                'db_table': 'cart_include',
            },
        ),
        migrations.AddField(
            model_name='cart',
            name='info',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mall.Userinfo'),
        ),
        migrations.AddField(
            model_name='address',
            name='info',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.UserLogin', verbose_name='选择用户'),
        ),
        migrations.CreateModel(
            name='OrderInclude',
            fields=[
                ('entry_2_id', models.AutoField(primary_key=True, serialize=False)),
                ('final_quantity', models.IntegerField(default=1)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Orders')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mall.Product')),
            ],
            options={
                'verbose_name_plural': '订单关联商品',
                'db_table': 'order_include',
                'unique_together': {('order', 'product')},
            },
        ),
    ]
