diff options
| author | user@node5.net <user@node5.net> | 2025-12-07 22:52:10 +0100 |
|---|---|---|
| committer | user@node5.net <user@node5.net> | 2025-12-07 22:52:10 +0100 |
| commit | 1f298c0f87097e0f154d00d0ead1a7fa4a17a40a (patch) | |
| tree | 2142f758d90684772ceb02e003f7763a48465aa4 /web_interface | |
| parent | 3fb1285bac940fafe953362fc9ee022fe3ec5387 (diff) | |
Fix migration not applying
Diffstat (limited to 'web_interface')
| -rw-r--r-- | web_interface/drinks/migrations/0001_initial.py (renamed from web_interface/drinks/migrations/0001_initial_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py) | 58 |
1 files changed, 21 insertions, 37 deletions
diff --git a/web_interface/drinks/migrations/0001_initial_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py b/web_interface/drinks/migrations/0001_initial.py index bb3d845..3157493 100644 --- a/web_interface/drinks/migrations/0001_initial_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py +++ b/web_interface/drinks/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 6.0 on 2025-12-07 11:29 +# Generated by Django 5.2.9 on 2025-12-07 21:51 import colorfield.fields import django.db.models.deletion @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): - replaces = [('drinks', '0001_initial_squashed_0006_alter_drink_author'), ('drinks', '0007_alter_ingredient_drink_alter_ingredient_unit')] + initial = True dependencies = [ ] @@ -16,7 +16,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Author', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('first_name', models.CharField(help_text='First name of the author of a drink', verbose_name='First name')), ('last_name', models.CharField(help_text='Last name of the author of a drink', verbose_name='Last name')), ], @@ -24,7 +24,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Bottle', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(help_text='Name of the type bottle. e.g. Coca Cola, *Specific Whiskey*', verbose_name='Bottle')), ('description', models.TextField(blank=True, help_text='Free text field that will be shown to the users', verbose_name='Description')), ('picture', models.ImageField(blank=True, help_text='A picture for the overview', upload_to='', verbose_name='Picture')), @@ -32,52 +32,36 @@ class Migration(migrations.Migration): ], ), migrations.CreateModel( + name='Drink', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(help_text='Name of the drink, for displaying in overview', verbose_name='Name')), + ('description', models.TextField(blank=True, help_text='Free text field that will be shown to the users', verbose_name='Description')), + ('picture', models.ImageField(blank=True, help_text='A picture for the overview', upload_to='', verbose_name='Picture')), + ('author', models.ForeignKey(blank=True, help_text='Author of the drink', null=True, on_delete=django.db.models.deletion.CASCADE, to='drinks.author', verbose_name='Author')), + ], + ), + migrations.CreateModel( name='Unit', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('abbreviation', models.CharField(help_text='E.g: ml.', verbose_name='Abbreviation')), ('name', models.CharField(blank=True, help_text='E.g: ml.', verbose_name='Name')), ('pump_time', models.FloatField(blank=True, help_text='Amount of time to run the pump for to dispence 1 of these units', verbose_name='Pump time')), ('valve_time', models.FloatField(blank=True, help_text='Amount of time to run the pump for to dispence 1 of these units', verbose_name='Pump time')), ], - ), - migrations.CreateModel( - name='Drink', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(help_text='Name of the drink, for displaying in overview', verbose_name='Name')), - ('description', models.TextField(blank=True, help_text='Free text field that will be shown to the users', verbose_name='Description')), - ('picture', models.ImageField(blank=True, help_text='A picture for the overview', upload_to='', verbose_name='Picture')), - ('author', models.ForeignKey(blank=True, help_text='Author of the drink', on_delete=django.db.models.deletion.CASCADE, to='drinks.author', verbose_name='Author')), - ], + options={ + 'constraints': [models.CheckConstraint(condition=models.Q(('pump_time__isnull', False), ('valve_time__isnull', False), _connector='OR'), name='one_of_valve_time_or_pump_time_must_be_filled')], + }, ), migrations.CreateModel( name='Ingredient', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('amount', models.IntegerField(help_text='In conjunction with unit it is an absolute amount', verbose_name='Amount')), ('bottle', models.ForeignKey(help_text="This ingredient's bottle", on_delete=django.db.models.deletion.CASCADE, to='drinks.bottle', verbose_name='Bottle')), - ('unit', models.ForeignKey(default=1, help_text='The unit that the ammount is messured in, e.g. ml.', on_delete=django.db.models.deletion.CASCADE, to='drinks.unit', verbose_name='Unit')), - ('drink', models.ForeignKey(default=1, help_text='The drink this ingredient is part of', on_delete=django.db.models.deletion.CASCADE, to='drinks.drink', verbose_name='Drink')), + ('drink', models.ForeignKey(help_text='The drink this ingredient is part of', on_delete=django.db.models.deletion.CASCADE, to='drinks.drink', verbose_name='Drink')), + ('unit', models.ForeignKey(help_text='The unit that the ammount is messured in, e.g. ml.', on_delete=django.db.models.deletion.CASCADE, to='drinks.unit', verbose_name='Unit')), ], ), - migrations.AddConstraint( - model_name='unit', - constraint=models.CheckConstraint(condition=models.Q(('pump_time__isnull', False), ('valve_time__isnull', False), _connector='OR'), name='one_of_valve_time_or_pump_time_must_be_filled'), - ), - migrations.AlterField( - model_name='drink', - name='author', - field=models.ForeignKey(blank=True, help_text='Author of the drink', null=True, on_delete=django.db.models.deletion.CASCADE, to='drinks.author', verbose_name='Author'), - ), - migrations.AlterField( - model_name='ingredient', - name='drink', - field=models.ForeignKey(help_text='The drink this ingredient is part of', on_delete=django.db.models.deletion.CASCADE, to='drinks.drink', verbose_name='Drink'), - ), - migrations.AlterField( - model_name='ingredient', - name='unit', - field=models.ForeignKey(help_text='The unit that the ammount is messured in, e.g. ml.', on_delete=django.db.models.deletion.CASCADE, to='drinks.unit', verbose_name='Unit'), - ), ] |
