#coding:utf-8
# Generated by Django 2.0.1 on 2018-01-10 02:24

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='类别名称')),
            ],
            options={
                'verbose_name_plural': '类别',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='名称')),
                ('value', models.ImageField(upload_to='media/color/', verbose_name='值')),
            ],
            options={
                'verbose_name_plural': '颜色',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='名称')),
                ('desc', models.CharField(max_length=100, verbose_name='描述')),
                ('price', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='价格')),
                ('oldprice', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='原价')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Category', verbose_name='类别')),
            ],
            options={
                'verbose_name_plural': '商品',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='GoodsDeatils',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='名称')),
            ],
            options={
                'verbose_name_plural': '详情',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='GoodsDeatilsItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.ImageField(upload_to='media/', verbose_name='图片')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Goods')),
                ('goodsdeatils', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsDeatils', verbose_name='详情')),
            ],
            options={
                'verbose_name_plural': '详情条目',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='名称')),
                ('value', models.CharField(max_length=20, verbose_name='值')),
            ],
            options={
                'verbose_name_plural': '尺寸',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='SKU',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.IntegerField(default=100, verbose_name='库存')),
                ('color', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Color', verbose_name='颜色')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Goods', verbose_name='商品')),
                ('size', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Size', verbose_name='尺寸')),
            ],
            options={
                'verbose_name_plural': '库存',
                'ordering': ['id'],
            },
        ),
    ]
