# Generated by Django 3.0.7 on 2020-07-30 04:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('detail', tinymce.models.HTMLField()),
            ],
            options={
                'verbose_name': 'Goods',
                'verbose_name_plural': 'Goodses',
                'db_table': 'df_goods',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='GoodsSKU',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('desc', models.CharField(max_length=256)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('unit', models.CharField(max_length=50)),
                ('sales', models.IntegerField(default=0)),
                ('stock', models.IntegerField(default=0)),
                ('image', models.ImageField(upload_to='')),
                ('status', models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')], default=1)),
                ('goods', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.Goods')),
            ],
            options={
                'verbose_name': 'GoodsSKU',
                'verbose_name_plural': 'GoodsSKUs',
                'db_table': 'df_goods_sku',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='GoodsType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('logo', models.CharField(max_length=50)),
                ('image', models.ImageField(upload_to='')),
            ],
            options={
                'verbose_name': 'GoodsType',
                'verbose_name_plural': 'GoodsTypes',
                'db_table': 'df_goods_type',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='IndexPromotionBanner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('image', models.ImageField(upload_to='')),
                ('url', models.URLField()),
                ('index', models.SmallIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'IndexPromotionBanner',
                'verbose_name_plural': 'IndexPromotionBanners',
                'db_table': 'df_index_promotion_banner',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='IndexTypeGoodsBanner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('index', models.SmallIntegerField(default=0)),
                ('display_type', models.SmallIntegerField(choices=[(0, '标题'), (1, '图片')], default=1)),
                ('goods_sku', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU')),
                ('goods_type', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsType')),
            ],
            options={
                'verbose_name': 'IndexTypeGoodsBanner',
                'verbose_name_plural': 'IndexTypeGoodsBanners',
                'db_table': 'df_index_type_goods_banner',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='IndexGoodsBanner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('image', models.ImageField(upload_to='')),
                ('index', models.SmallIntegerField(default=0)),
                ('goods_sku', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU')),
            ],
            options={
                'verbose_name': 'IndexGoodsBanner',
                'verbose_name_plural': 'IndexGoodsBanners',
                'db_table': 'df_index_goods_banner',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='goodssku',
            name='goods_type',
            field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsType'),
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateField(auto_now_add=True)),
                ('update_time', models.DateField(auto_now=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('image', models.ImageField(upload_to='')),
                ('goods_sku', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsSKU')),
            ],
            options={
                'verbose_name': 'GoodsImage',
                'verbose_name_plural': 'GoodsImages',
                'db_table': '',
                'managed': True,
            },
        ),
    ]
