# Generated by Django 3.1.1 on 2020-11-24 05:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='商品名称')),
                ('price', models.FloatField(verbose_name='商品价格')),
                ('image', models.ImageField(upload_to='shop/images', verbose_name='商品图片')),
                ('stock', models.IntegerField(verbose_name='库存')),
                ('description', models.TextField(verbose_name='商品描述')),
                ('createdDate', models.DateField(verbose_name='上架时间')),
            ],
        ),
        migrations.CreateModel(
            name='ShopType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shopType', models.CharField(max_length=32, verbose_name='店铺类型')),
                ('description', models.TextField(verbose_name='详细信息')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=32, verbose_name='用户名')),
                ('password', models.CharField(max_length=32, verbose_name='密码')),
                ('nickname', models.CharField(blank=True, max_length=16, null=True, verbose_name='昵称')),
                ('phoneNumber', models.CharField(blank=True, max_length=16, null=True, verbose_name='手机号码')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='邮箱')),
                ('avatar', models.ImageField(blank=True, null=True, upload_to='shop/images', verbose_name='头像')),
                ('address', models.CharField(blank=True, max_length=32, null=True, verbose_name='地址')),
                ('creditCard', models.CharField(blank=True, max_length=32, null=True, verbose_name='银行卡号')),
            ],
        ),
        migrations.CreateModel(
            name='Shop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shopName', models.CharField(max_length=32, verbose_name='店铺名称')),
                ('address', models.CharField(max_length=32, verbose_name='地址')),
                ('description', models.TextField(verbose_name='描述')),
                ('avatar', models.ImageField(upload_to='store/images', verbose_name='logo')),
                ('phoneNumber', models.CharField(max_length=32, verbose_name='联系电话')),
                ('userId', models.IntegerField(verbose_name='店主')),
                ('type', models.ManyToManyField(to='shop.ShopType', verbose_name='店铺类型')),
            ],
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.ImageField(upload_to='store/images', verbose_name='图片地址')),
                ('description', models.TextField(verbose_name='图片描述')),
                ('productId', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.product', verbose_name='商品id')),
            ],
        ),
        migrations.AddField(
            model_name='product',
            name='storeId',
            field=models.ManyToManyField(to='shop.Shop', verbose_name='商品店铺'),
        ),
    ]
