# Generated by Django 3.0.7 on 2020-06-29 12:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('product', '0013_merge_20200629_2132'),
        ('account', '0002_auto_20200629_2133'),
    ]

    operations = [
        migrations.CreateModel(
            name='OrderStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, null=True)),
            ],
            options={
                'db_table': 'order_status',
            },
        ),
        migrations.CreateModel(
            name='UserOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_time', models.DateField(auto_now_add=True)),
                ('address', models.CharField(max_length=16000, null=True)),
                ('discounst', models.DecimalField(decimal_places=2, max_digits=4)),
                ('final_price', models.DecimalField(decimal_places=2, max_digits=30)),
                ('order_status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cart.OrderStatus')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.Account')),
            ],
            options={
                'db_table': 'user_orders',
            },
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_price', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.ProductPrice')),
                ('user_order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cart.UserOrder')),
            ],
            options={
                'db_table': 'order_items',
            },
        ),
    ]
