# Generated by Django 2.0.2 on 2018-02-15 23:51

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total', models.DecimalField(decimal_places=2, default=0, max_digits=9)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('status', models.IntegerField(choices=[(1, 'Received'), (2, 'Processing'), (3, 'Payment complete'), (4, 'Shipping'), (5, 'Completed'), (6, 'Cancelled')], default='1')),
            ],
        ),
        migrations.CreateModel(
            name='OrderCustomer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('customer_id', models.IntegerField()),
                ('name', models.CharField(max_length=100)),
                ('email', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='OrderItems',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_id', models.IntegerField()),
                ('name', models.CharField(max_length=200)),
                ('quantity', models.IntegerField()),
                ('price_per_unit', models.DecimalField(decimal_places=2, default=0, max_digits=9)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='main.Order')),
            ],
            options={
                'verbose_name_plural': 'Order items',
            },
        ),
        migrations.AddField(
            model_name='order',
            name='order_customer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.OrderCustomer'),
        ),
    ]
