From 1f298c0f87097e0f154d00d0ead1a7fa4a17a40a Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Sun, 7 Dec 2025 22:52:10 +0100 Subject: Fix migration not applying --- web_interface/drinks/migrations/0001_initial.py | 67 +++++++++++++++++ ...alter_ingredient_drink_alter_ingredient_unit.py | 83 ---------------------- 2 files changed, 67 insertions(+), 83 deletions(-) create mode 100644 web_interface/drinks/migrations/0001_initial.py delete mode 100644 web_interface/drinks/migrations/0001_initial_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py (limited to 'web_interface') diff --git a/web_interface/drinks/migrations/0001_initial.py b/web_interface/drinks/migrations/0001_initial.py new file mode 100644 index 0000000..3157493 --- /dev/null +++ b/web_interface/drinks/migrations/0001_initial.py @@ -0,0 +1,67 @@ +# Generated by Django 5.2.9 on 2025-12-07 21:51 + +import colorfield.fields +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Author', + fields=[ + ('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')), + ], + ), + migrations.CreateModel( + name='Bottle', + fields=[ + ('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')), + ('color', colorfield.fields.ColorField(blank=True, default='', help_text='Color of the drink, used in the UI', image_field='picture', max_length=25, samples=None, verbose_name='Color')), + ], + ), + 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.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')), + ], + 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.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')), + ('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')), + ], + ), + ] 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_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py deleted file mode 100644 index bb3d845..0000000 --- a/web_interface/drinks/migrations/0001_initial_squashed_0006_alter_drink_author_squashed_0007_alter_ingredient_drink_alter_ingredient_unit.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 6.0 on 2025-12-07 11:29 - -import colorfield.fields -import django.db.models.deletion -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')] - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Author', - fields=[ - ('id', models.BigAutoField(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')), - ], - ), - migrations.CreateModel( - name='Bottle', - fields=[ - ('id', models.BigAutoField(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')), - ('color', colorfield.fields.ColorField(blank=True, default='', help_text='Color of the drink, used in the UI', image_field='picture', max_length=25, samples=None, verbose_name='Color')), - ], - ), - migrations.CreateModel( - name='Unit', - fields=[ - ('id', models.BigAutoField(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')), - ], - ), - migrations.CreateModel( - name='Ingredient', - fields=[ - ('id', models.BigAutoField(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')), - ], - ), - 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'), - ), - ] -- cgit v1.3.1