# Generated by Django 4.1.7 on 2023-03-17 14:25

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


class Migration(migrations.Migration):
    dependencies = [
        ("order", "0004_item_ordered_nb"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="item",
            name="ordered_nb",
        ),
        migrations.AlterField(
            model_name="order",
            name="grouped_order",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="order_set",
                to="order.grouped_order",
            ),
        ),
        migrations.CreateModel(
            name="OrderedItem",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("nb", models.PositiveSmallIntegerField(default=0)),
                (
                    "item",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ordered_items",
                        to="order.item",
                    ),
                ),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="orders",
                        to="order.order",
                    ),
                ),
            ],
        ),
    ]
