<filename>backend/orders/migrations/0001_initial.py
# Generated by Django 3.2.8 on 2022-02-15 20:50

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('products', '0002_auto_20220215_2350'),
    ]

    operations = [
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('paid', 'Paid'), ('waiting', 'Waiting'), ('declined', 'Declined')], default='waiting', max_length=250)),
                ('status_description', models.TextField()),
                ('details', models.TextField()),
                ('invoice_date', models.DateField(default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('started', 'Started'), ('processing', 'Processing'), ('ready_to_ship', 'Ready To Ship'), ('delivered', 'Delivered'), ('cancelled', 'Cancelled'), ('shop_failed', 'Shop Failed'), ('declined', 'Declined')], default='started', max_length=250)),
                ('status_description', models.TextField()),
                ('date_order_placed', models.DateField(default=datetime.datetime.now)),
                ('order_details', models.TextField()),
                ('created_at', models.DateField(default=datetime.datetime.now)),
                ('updated_at', models.DateField(default=datetime.datetime.now)),
                ('shipment_tracking_id', models.SlugField(null=True)),
                ('shipment_date', models.DateField(null=True)),
                ('shipment_details', models.TextField()),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_date', models.DateField(default=datetime.datetime.now)),
                ('payment_amount', models.FloatField()),
                ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.invoice')),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('started', 'Started')], default='started', max_length=250)),
                ('quantity', models.PositiveIntegerField()),
                ('price', models.FloatField()),
                ('details', models.TextField()),
                ('ordered_at', models.DateField(default=datetime.datetime.now)),
                ('updated_at', models.DateField(default=datetime.datetime.now)),
                ('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')),
            ],
        ),
        migrations.AddField(
            model_name='invoice',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.order'),
        ),
    ]

<filename>backend/orders/migrations/0001_initial.py
# Generated by Django 3.2.8 on 2022-02-15 20:50

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('products', '0002_auto_20220215_2350'),
    ]

    operations = [
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('paid', 'Paid'), ('waiting', 'Waiting'), ('declined', 'Declined')], default='waiting', max_length=250)),
                ('status_description', models.TextField()),
                ('details', models.TextField()),
                ('invoice_date', models.DateField(default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('started', 'Started'), ('processing', 'Processing'), ('ready_to_ship', 'Ready To Ship'), ('delivered', 'Delivered'), ('cancelled', 'Cancelled'), ('shop_failed', 'Shop Failed'), ('declined', 'Declined')], default='started', max_length=250)),
                ('status_description', models.TextField()),
                ('date_order_placed', models.DateField(default=datetime.datetime.now)),
                ('order_details', models.TextField()),
                ('created_at', models.DateField(default=datetime.datetime.now)),
                ('updated_at', models.DateField(default=datetime.datetime.now)),
                ('shipment_tracking_id', models.SlugField(null=True)),
                ('shipment_date', models.DateField(null=True)),
                ('shipment_details', models.TextField()),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_date', models.DateField(default=datetime.datetime.now)),
                ('payment_amount', models.FloatField()),
                ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.invoice')),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_code', models.CharField(choices=[('started', 'Started')], default='started', max_length=250)),
                ('quantity', models.PositiveIntegerField()),
                ('price', models.FloatField()),
                ('details', models.TextField()),
                ('ordered_at', models.DateField(default=datetime.datetime.now)),
                ('updated_at', models.DateField(default=datetime.datetime.now)),
                ('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')),
            ],
        ),
        migrations.AddField(
            model_name='invoice',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.order'),
        ),
    ]

# Generated by Django 3.2.8 on 2022-02-15 20:50