# Generated by Django 3.1.5 on 2021-04-07 15:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('products', '0001_initial'),
        ('address', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=100, unique=True, verbose_name='Order Code')),
                ('status', models.CharField(default='', max_length=100, verbose_name='Status')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update Date')),
                ('address', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='address.address')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'order',
                'verbose_name_plural': 'orders',
                'db_table': 'rt_order',
                'ordering': ('-updated',),
            },
        ),
        migrations.CreateModel(
            name='OrderDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(default=1, null=True, verbose_name='Quantity')),
                ('request_text', models.CharField(max_length=500, null=True, verbose_name='Request')),
                ('price', models.IntegerField(default=0, null=True, verbose_name='Price')),
                ('sale_price', models.IntegerField(default=0, null=True, verbose_name='Sale Price')),
                ('shipping_fee', models.IntegerField(default=0, null=True, verbose_name='Shipping Fee')),
                ('total_price', models.IntegerField(default=0, null=True, verbose_name='Total Price')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update Date')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.order')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'verbose_name': 'order_detail',
                'verbose_name_plural': 'order_details',
                'db_table': 'rt_order_detail',
                'ordering': ('-updated',),
            },
        ),
    ]
