From 19dc98f4768374c2e2a18d97583086a6d18dc6c5 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Thu, 22 Aug 2024 13:21:59 +0200 Subject: [PATCH] Adjust squashed migrations to not use index_together and unique_together in them --- dash/categories/migrations/0001_squashed.py | 4 --- dash/dashblocks/migrations/0001_squashed.py | 31 ++++----------------- dash/orgs/migrations/0001_squashed.py | 21 ++------------ dash/tags/migrations/0001_squashed.py | 3 -- 4 files changed, 8 insertions(+), 51 deletions(-) diff --git a/dash/categories/migrations/0001_squashed.py b/dash/categories/migrations/0001_squashed.py index b92d56a..06ca8cd 100644 --- a/dash/categories/migrations/0001_squashed.py +++ b/dash/categories/migrations/0001_squashed.py @@ -277,10 +277,6 @@ class Migration(migrations.Migration): to=settings.AUTH_USER_MODEL, ), ), - migrations.AlterUniqueTogether( - name="category", - unique_together=set(), - ), migrations.AddConstraint( model_name="category", constraint=models.UniqueConstraint(fields=("name", "org"), name="categories_category_name_unique"), diff --git a/dash/dashblocks/migrations/0001_squashed.py b/dash/dashblocks/migrations/0001_squashed.py index cd6fbba..1986710 100644 --- a/dash/dashblocks/migrations/0001_squashed.py +++ b/dash/dashblocks/migrations/0001_squashed.py @@ -634,32 +634,13 @@ class Migration(migrations.Migration): to=settings.AUTH_USER_MODEL, ), ), - migrations.AlterIndexTogether( - name="dashblock", - index_together={("org", "is_active", "dashblock_type", "priority")}, - ), - migrations.AlterIndexTogether( - name="dashblocktype", - index_together={("slug", "name")}, - ), - migrations.RenameIndex( - model_name="dashblock", - new_name="dashblocks__org_id_024805_idx", - old_fields=("org", "is_active", "dashblock_type", "priority"), - ), - migrations.RenameIndex( - model_name="dashblocktype", - new_name="dashblocks__slug_c0c6c6_idx", - old_fields=("slug", "name"), - ), - migrations.RenameIndex( + migrations.AddIndex( model_name="dashblock", - new_name="dashblock_org_typ_prio_idx", - old_name="dashblocks__org_id_024805_idx", + index=models.Index( + fields=["org", "is_active", "dashblock_type", "priority"], name="dashblock_org_typ_prio_idx" + ), ), - migrations.RenameIndex( - model_name="dashblocktype", - new_name="dashblocktype_slug_name_idx", - old_name="dashblocks__slug_c0c6c6_idx", + migrations.AddIndex( + model_name="dashblocktype", index=models.Index(fields=["slug", "name"], name="dashblocktype_slug_name_idx") ), ] diff --git a/dash/orgs/migrations/0001_squashed.py b/dash/orgs/migrations/0001_squashed.py index e3ebefd..aca1a8d 100644 --- a/dash/orgs/migrations/0001_squashed.py +++ b/dash/orgs/migrations/0001_squashed.py @@ -609,10 +609,6 @@ class Migration(migrations.Migration): field=models.CharField(default="", max_length=128), preserve_default=False, ), - migrations.AlterUniqueTogether( - name="orgbackend", - unique_together={("org", "slug")}, - ), migrations.RunPython( code=fix_org_config_rapidpro, reverse_code=noop, @@ -727,22 +723,9 @@ class Migration(migrations.Migration): to=settings.AUTH_USER_MODEL, ), ), - migrations.AlterIndexTogether( - name="orgbackend", - index_together={("org", "is_active", "slug")}, - ), - migrations.RenameIndex( + migrations.AddIndex( model_name="orgbackend", - new_name="orgs_orgbac_org_slug_idx", - old_fields=("org", "is_active", "slug"), - ), - migrations.AlterUniqueTogether( - name="orgbackend", - unique_together=set(), - ), - migrations.AlterUniqueTogether( - name="taskstate", - unique_together=set(), + index=models.Index(fields=["org", "is_active", "slug"], name="orgs_orgbac_org_slug_idx"), ), migrations.AddConstraint( model_name="orgbackend", diff --git a/dash/tags/migrations/0001_squashed.py b/dash/tags/migrations/0001_squashed.py index cef6b3d..2db93e3 100644 --- a/dash/tags/migrations/0001_squashed.py +++ b/dash/tags/migrations/0001_squashed.py @@ -72,9 +72,6 @@ class Migration(migrations.Migration): ), ("org", models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to="orgs.org")), ], - options={ - "unique_together": set(), - }, ), migrations.AddConstraint( model_name="tag",