# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-14 00:47
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0022_auto_20170531_1943'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('desk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Desk', verbose_name='桌号')),
            ],
            options={
                'verbose_name_plural': '购物车',
                'verbose_name': '购物车',
            },
        ),
        migrations.CreateModel(
            name='CartDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('num', models.IntegerField(verbose_name='数量')),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Cart', verbose_name='购物车')),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Food', verbose_name='商品')),
            ],
            options={
                'verbose_name_plural': '购物车详情',
                'verbose_name': '购物车详情',
            },
        ),
        migrations.CreateModel(
            name='CouponCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_receive', models.BooleanField(default=False, verbose_name='是否领取')),
                ('is_use', models.BooleanField(default=False, verbose_name='是否使用')),
                ('code', models.CharField(max_length=30, verbose_name='优惠券码')),
            ],
            options={
                'verbose_name_plural': '优惠券码',
                'verbose_name': '优惠券码',
            },
        ),
        migrations.RemoveField(
            model_name='fullminusdetail',
            name='full_minus_coupon',
        ),
        migrations.RemoveField(
            model_name='fullminusdetail',
            name='gift',
        ),
        migrations.RemoveField(
            model_name='unitedetail',
            name='unite_coupon',
        ),
        migrations.RemoveField(
            model_name='discountcoupon',
            name='count',
        ),
        migrations.RemoveField(
            model_name='discountcoupon',
            name='daily_limit',
        ),
        migrations.RemoveField(
            model_name='discountcoupon',
            name='single_limit',
        ),
        migrations.RemoveField(
            model_name='fullminuscoupon',
            name='count',
        ),
        migrations.RemoveField(
            model_name='fullminuscoupon',
            name='daily_limit',
        ),
        migrations.RemoveField(
            model_name='fullminuscoupon',
            name='single_limit',
        ),
        migrations.RemoveField(
            model_name='unitecoupon',
            name='count',
        ),
        migrations.RemoveField(
            model_name='unitecoupon',
            name='daily_limit',
        ),
        migrations.RemoveField(
            model_name='unitecoupon',
            name='single_limit',
        ),
        migrations.AddField(
            model_name='coupon',
            name='background',
            field=models.ImageField(blank=True, null=True, upload_to='coupon_backgroud/', verbose_name='背景图片'),
        ),
        migrations.AddField(
            model_name='coupon',
            name='code',
            field=models.CharField(default=0, max_length=20, verbose_name='代码'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='coupon',
            name='count',
            field=models.IntegerField(blank=True, null=True, verbose_name='发放张数'),
        ),
        migrations.AddField(
            model_name='coupon',
            name='daily_limit',
            field=models.IntegerField(blank=True, null=True, verbose_name='每日每人限额'),
        ),
        migrations.AddField(
            model_name='coupon',
            name='show_img',
            field=models.ImageField(blank=True, null=True, upload_to='show_img/', verbose_name='展示图'),
        ),
        migrations.AddField(
            model_name='coupon',
            name='single_limit',
            field=models.IntegerField(blank=True, null=True, verbose_name='单人限额'),
        ),
        migrations.AddField(
            model_name='discountcoupon',
            name='num',
            field=models.IntegerField(default=0, verbose_name='赠品数量'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='coupon_type',
            field=models.IntegerField(choices=[(0, '减'), (1, '赠商品'), (2, '赠会员点')], default=1, verbose_name='促销方式'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='full',
            field=models.IntegerField(default=0, verbose_name='满'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='gift',
            field=models.ForeignKey(blank=True, default=1, on_delete=django.db.models.deletion.CASCADE, to='user.Food', verbose_name='赠品'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='minus',
            field=models.IntegerField(default=0, verbose_name='减'),
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='num',
            field=models.IntegerField(default=0, verbose_name='数量'),
        ),
        migrations.AddField(
            model_name='fullminuscoupon',
            name='point',
            field=models.IntegerField(default=0, verbose_name='赠会员点'),
        ),
        migrations.AddField(
            model_name='unitecoupon',
            name='category_price',
            field=models.IntegerField(default=0, verbose_name='系列均一价格'),
        ),
        migrations.AddField(
            model_name='unitecoupon',
            name='coupon_type',
            field=models.IntegerField(choices=[(0, '系列均一'), (1, '多选均一')], default=1, verbose_name='类型'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='unitecoupon',
            name='price',
            field=models.IntegerField(default=0, verbose_name='多选均一价格'),
        ),
        migrations.AddField(
            model_name='unitecoupon',
            name='select',
            field=models.IntegerField(default=0, verbose_name='选'),
        ),
        migrations.AlterField(
            model_name='coupon',
            name='category',
            field=models.ManyToManyField(blank=True, to='user.FoodCategory', verbose_name='打折类别'),
        ),
        migrations.AlterField(
            model_name='coupon',
            name='detail_minor',
            field=models.CharField(max_length=200, verbose_name='优惠券详情 - 次'),
        ),
        migrations.AlterField(
            model_name='discountcoupon',
            name='coupon',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='discount', to='user.Coupon', verbose_name='优惠券'),
        ),
        migrations.RemoveField(
            model_name='discountcoupon',
            name='gift',
        ),
        migrations.AddField(
            model_name='discountcoupon',
            name='gift',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='user.Food', verbose_name='赠品'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='fullminuscoupon',
            name='coupon',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='fullminus', to='user.Coupon', verbose_name='优惠券'),
        ),
        migrations.AlterField(
            model_name='unitecoupon',
            name='coupon',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='unite', to='user.Coupon', verbose_name='优惠券'),
        ),
        migrations.DeleteModel(
            name='FullMinusDetail',
        ),
        migrations.DeleteModel(
            name='UniteDetail',
        ),
        migrations.AddField(
            model_name='couponcode',
            name='coupon',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Coupon', verbose_name='优惠券'),
        ),
        migrations.AddField(
            model_name='couponcode',
            name='receive_user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='领取用户'),
        ),
    ]
