From 0a74f626274f9dd11e157ca8a30a4d353062f065 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Thu, 1 Aug 2024 12:51:21 +0200 Subject: [PATCH] Reduce amount of migrations --- ...tions_rename_user_order_member_and_more.py | 42 +++++++++++++++++++ .../0007_rename_user_order_member.py | 18 -------- ...erproduct_options_orderproduct_quantity.py | 22 ---------- ...roduct_order_alter_orderproduct_product.py | 24 ----------- ...010_alter_orderproduct_options_and_more.py | 21 ---------- ...ivated_membership_activated_on_and_more.py | 11 ++++- .../migrations/0008_alter_membership_user.py | 21 ---------- 7 files changed, 51 insertions(+), 108 deletions(-) create mode 100644 src/accounting/migrations/0007_alter_orderproduct_options_rename_user_order_member_and_more.py delete mode 100644 src/accounting/migrations/0007_rename_user_order_member.py delete mode 100644 src/accounting/migrations/0008_alter_orderproduct_options_orderproduct_quantity.py delete mode 100644 src/accounting/migrations/0009_alter_orderproduct_order_alter_orderproduct_product.py delete mode 100644 src/accounting/migrations/0010_alter_orderproduct_options_and_more.py delete mode 100644 src/membership/migrations/0008_alter_membership_user.py diff --git a/src/accounting/migrations/0007_alter_orderproduct_options_rename_user_order_member_and_more.py b/src/accounting/migrations/0007_alter_orderproduct_options_rename_user_order_member_and_more.py new file mode 100644 index 0000000..c60aba3 --- /dev/null +++ b/src/accounting/migrations/0007_alter_orderproduct_options_rename_user_order_member_and_more.py @@ -0,0 +1,42 @@ +# Generated by Django 5.1b1 on 2024-08-01 10:50 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounting', '0006_alter_account_owner_alter_order_user'), + ] + + operations = [ + migrations.AlterModelOptions( + name='orderproduct', + options={'verbose_name': 'ordered product', 'verbose_name_plural': 'ordered products'}, + ), + migrations.RenameField( + model_name='order', + old_name='user', + new_name='member', + ), + migrations.RemoveField( + model_name='payment', + name='stripe_charge_id', + ), + migrations.AddField( + model_name='orderproduct', + name='quantity', + field=models.PositiveSmallIntegerField(default=1), + ), + migrations.AlterField( + model_name='orderproduct', + name='order', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='accounting.order'), + ), + migrations.AlterField( + model_name='orderproduct', + name='product', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='accounting.product'), + ), + ] diff --git a/src/accounting/migrations/0007_rename_user_order_member.py b/src/accounting/migrations/0007_rename_user_order_member.py deleted file mode 100644 index 9108b34..0000000 --- a/src/accounting/migrations/0007_rename_user_order_member.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 5.0.7 on 2024-07-21 15:17 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('accounting', '0006_alter_account_owner_alter_order_user'), - ] - - operations = [ - migrations.RenameField( - model_name='order', - old_name='user', - new_name='member', - ), - ] diff --git a/src/accounting/migrations/0008_alter_orderproduct_options_orderproduct_quantity.py b/src/accounting/migrations/0008_alter_orderproduct_options_orderproduct_quantity.py deleted file mode 100644 index 51a56e0..0000000 --- a/src/accounting/migrations/0008_alter_orderproduct_options_orderproduct_quantity.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 5.1b1 on 2024-07-28 21:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accounting', '0007_rename_user_order_member'), - ] - - operations = [ - migrations.AlterModelOptions( - name='orderproduct', - options={'verbose_name': 'ordered products'}, - ), - migrations.AddField( - model_name='orderproduct', - name='quantity', - field=models.PositiveSmallIntegerField(default=1), - ), - ] diff --git a/src/accounting/migrations/0009_alter_orderproduct_order_alter_orderproduct_product.py b/src/accounting/migrations/0009_alter_orderproduct_order_alter_orderproduct_product.py deleted file mode 100644 index ac36b45..0000000 --- a/src/accounting/migrations/0009_alter_orderproduct_order_alter_orderproduct_product.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 5.1b1 on 2024-07-28 21:27 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accounting', '0008_alter_orderproduct_options_orderproduct_quantity'), - ] - - operations = [ - migrations.AlterField( - model_name='orderproduct', - name='order', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='accounting.order'), - ), - migrations.AlterField( - model_name='orderproduct', - name='product', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='accounting.product'), - ), - ] diff --git a/src/accounting/migrations/0010_alter_orderproduct_options_and_more.py b/src/accounting/migrations/0010_alter_orderproduct_options_and_more.py deleted file mode 100644 index 4a710b3..0000000 --- a/src/accounting/migrations/0010_alter_orderproduct_options_and_more.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 5.1b1 on 2024-07-31 22:02 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('accounting', '0009_alter_orderproduct_order_alter_orderproduct_product'), - ] - - operations = [ - migrations.AlterModelOptions( - name='orderproduct', - options={'verbose_name': 'ordered product', 'verbose_name_plural': 'ordered products'}, - ), - migrations.RemoveField( - model_name='payment', - name='stripe_charge_id', - ), - ] diff --git a/src/membership/migrations/0007_membership_activated_membership_activated_on_and_more.py b/src/membership/migrations/0007_membership_activated_membership_activated_on_and_more.py index 0c7c57d..cedb798 100644 --- a/src/membership/migrations/0007_membership_activated_membership_activated_on_and_more.py +++ b/src/membership/migrations/0007_membership_activated_membership_activated_on_and_more.py @@ -1,14 +1,16 @@ -# Generated by Django 5.1b1 on 2024-07-25 22:47 +# Generated by Django 5.1b1 on 2024-08-01 10:50 import django.db.models.deletion +from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('accounting', '0007_rename_user_order_member'), + ('accounting', '0007_alter_orderproduct_options_rename_user_order_member_and_more'), ('membership', '0006_waitinglistentry_alter_membership_options'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ @@ -52,4 +54,9 @@ class Migration(migrations.Migration): name='products', field=models.ManyToManyField(to='accounting.product'), ), + migrations.AlterField( + model_name='membership', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to=settings.AUTH_USER_MODEL), + ), ] diff --git a/src/membership/migrations/0008_alter_membership_user.py b/src/membership/migrations/0008_alter_membership_user.py deleted file mode 100644 index d7f13ac..0000000 --- a/src/membership/migrations/0008_alter_membership_user.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 5.1b1 on 2024-07-28 21:20 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('membership', '0007_membership_activated_membership_activated_on_and_more'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AlterField( - model_name='membership', - name='user', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to=settings.AUTH_USER_MODEL), - ), - ]