# Generated by Django 2.1.4 on 2018-12-20 08:58

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('members', '0001_initial'),
        ('store', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CartItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveIntegerField(default=0, verbose_name='수량')),
                ('is_ordered', models.BooleanField(default=False, verbose_name='주문상태')),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item', related_query_name='items', to='orders.Cart', verbose_name='장바구니')),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='in_cart', related_query_name='in_carts', to='store.Food', verbose_name='음식')),
                ('options', models.ManyToManyField(related_name='option', related_query_name='options', to='store.SideDishes')),
            ],
            options={
                'verbose_name': '아이템',
                'verbose_name_plural': '아이템 목록',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shipping', models.CharField(max_length=50, verbose_name='배송지')),
                ('created_at', models.DateTimeField(auto_now=True, verbose_name='주문일자')),
                ('payment_status', models.BooleanField(default=False, verbose_name='결제상태')),
                ('payment_option', models.CharField(blank=True, max_length=50, verbose_name='결제수단')),
                ('comment', models.TextField(blank=True, verbose_name='요청사항')),
                ('phone', models.CharField(blank=True, max_length=13, verbose_name='전화번호')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '주문',
                'verbose_name_plural': '주문 목록',
            },
        ),
        migrations.AddField(
            model_name='cartitem',
            name='order',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='orders.Order', verbose_name='주문번호'),
        ),
    ]
