|
| 1 | +# Generated by Django 4.2.17 on 2025-02-25 04:12 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | +import django.db.models.deletion |
| 5 | +import uuid |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + |
| 10 | + dependencies = [ |
| 11 | + ("item", "0001_initial"), |
| 12 | + ] |
| 13 | + |
| 14 | + operations = [ |
| 15 | + migrations.CreateModel( |
| 16 | + name="Addon", |
| 17 | + fields=[ |
| 18 | + ( |
| 19 | + "id", |
| 20 | + models.UUIDField( |
| 21 | + default=uuid.uuid4, |
| 22 | + editable=False, |
| 23 | + primary_key=True, |
| 24 | + serialize=False, |
| 25 | + ), |
| 26 | + ), |
| 27 | + ("created_at", models.DateTimeField(auto_now_add=True)), |
| 28 | + ("updated_at", models.DateTimeField(auto_now=True)), |
| 29 | + ("deleted_at", models.DateTimeField(blank=True, null=True)), |
| 30 | + ("name", models.CharField(max_length=100)), |
| 31 | + ("description", models.TextField(blank=True, null=True)), |
| 32 | + ("price", models.DecimalField(decimal_places=2, max_digits=10)), |
| 33 | + ("remaining_quantities", models.PositiveIntegerField(default=0)), |
| 34 | + ("ingredients", models.JSONField(blank=True, null=True)), |
| 35 | + ], |
| 36 | + options={ |
| 37 | + "db_table": "addon", |
| 38 | + }, |
| 39 | + ), |
| 40 | + migrations.CreateModel( |
| 41 | + name="ItemVariation", |
| 42 | + fields=[ |
| 43 | + ( |
| 44 | + "id", |
| 45 | + models.UUIDField( |
| 46 | + default=uuid.uuid4, |
| 47 | + editable=False, |
| 48 | + primary_key=True, |
| 49 | + serialize=False, |
| 50 | + ), |
| 51 | + ), |
| 52 | + ("created_at", models.DateTimeField(auto_now_add=True)), |
| 53 | + ("updated_at", models.DateTimeField(auto_now=True)), |
| 54 | + ("deleted_at", models.DateTimeField(blank=True, null=True)), |
| 55 | + ("name", models.CharField(max_length=100)), |
| 56 | + ("description", models.TextField(blank=True, null=True)), |
| 57 | + ("price", models.DecimalField(decimal_places=2, max_digits=10)), |
| 58 | + ("ingredients", models.JSONField(blank=True, null=True)), |
| 59 | + ( |
| 60 | + "item", |
| 61 | + models.ForeignKey( |
| 62 | + on_delete=django.db.models.deletion.CASCADE, |
| 63 | + related_name="variations", |
| 64 | + to="item.item", |
| 65 | + ), |
| 66 | + ), |
| 67 | + ], |
| 68 | + options={ |
| 69 | + "db_table": "item_variation", |
| 70 | + }, |
| 71 | + ), |
| 72 | + migrations.CreateModel( |
| 73 | + name="ItemAddon", |
| 74 | + fields=[ |
| 75 | + ( |
| 76 | + "id", |
| 77 | + models.UUIDField( |
| 78 | + default=uuid.uuid4, |
| 79 | + editable=False, |
| 80 | + primary_key=True, |
| 81 | + serialize=False, |
| 82 | + ), |
| 83 | + ), |
| 84 | + ("created_at", models.DateTimeField(auto_now_add=True)), |
| 85 | + ("updated_at", models.DateTimeField(auto_now=True)), |
| 86 | + ("deleted_at", models.DateTimeField(blank=True, null=True)), |
| 87 | + ( |
| 88 | + "addon", |
| 89 | + models.ForeignKey( |
| 90 | + on_delete=django.db.models.deletion.CASCADE, |
| 91 | + related_name="items", |
| 92 | + to="item.addon", |
| 93 | + ), |
| 94 | + ), |
| 95 | + ( |
| 96 | + "item", |
| 97 | + models.ForeignKey( |
| 98 | + on_delete=django.db.models.deletion.CASCADE, |
| 99 | + related_name="addons", |
| 100 | + to="item.item", |
| 101 | + ), |
| 102 | + ), |
| 103 | + ], |
| 104 | + options={ |
| 105 | + "db_table": "item_addon", |
| 106 | + }, |
| 107 | + ), |
| 108 | + ] |
0 commit comments