# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2018-06-04 02:37
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now_add=True, verbose_name='更新时间')),
                ('value', models.CharField(blank=True, max_length=1024, null=True, verbose_name='色值')),
                ('image', models.ImageField(blank=True, null=True, upload_to='media/product/color', verbose_name='颜色图片')),
                ('order', models.PositiveSmallIntegerField(default=0, help_text='该颜色在颜色列表中的顺序', verbose_name='颜色顺序')),
            ],
            options={
                'ordering': ['order'],
                'verbose_name_plural': '商品颜色',
                'verbose_name': '商品颜色',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now_add=True, verbose_name='更新时间')),
                ('image', models.ImageField(upload_to='media/product/image', verbose_name='商品轮播图')),
                ('order', models.PositiveSmallIntegerField(default=0, help_text='该图片在图片列表中的顺序', verbose_name='图片顺序')),
                ('remarks', models.CharField(blank=True, max_length=1024, null=True, verbose_name='备注')),
            ],
            options={
                'ordering': ['order'],
                'verbose_name_plural': '轮播图片',
                'verbose_name': '轮播图片',
            },
        ),
        migrations.CreateModel(
            name='Value',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否激活')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now_add=True, verbose_name='更新时间')),
                ('value', models.CharField(max_length=128, verbose_name='参数内容')),
                ('order', models.PositiveSmallIntegerField(default=0, help_text='该参数在参数列表中的顺序', verbose_name='参数顺序')),
            ],
            options={
                'ordering': ['order'],
                'verbose_name_plural': '商品颜色',
                'verbose_name': '商品颜色',
            },
        ),
        migrations.RemoveField(
            model_name='product',
            name='detail_image',
        ),
        migrations.AddField(
            model_name='product',
            name='parameter_image',
            field=models.ImageField(blank=True, null=True, upload_to='media/product/product/parameter_image', verbose_name='商品参数图片'),
        ),
        migrations.AddField(
            model_name='value',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='value_product', to='product.Product', verbose_name='所属商品'),
        ),
        migrations.AddField(
            model_name='image',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image_product', to='product.Product', verbose_name='所属商品'),
        ),
        migrations.AddField(
            model_name='color',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='color_product', to='product.Product', verbose_name='所属商品'),
        ),
    ]
