Skip to content

Commit

Permalink
Adjust squashed migrations to not use index_together and unique_toget…
Browse files Browse the repository at this point in the history
…her in them
  • Loading branch information
norkans7 committed Aug 22, 2024
1 parent 164b38c commit 19dc98f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 51 deletions.
4 changes: 0 additions & 4 deletions dash/categories/migrations/0001_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
31 changes: 6 additions & 25 deletions dash/dashblocks/migrations/0001_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
),
]
21 changes: 2 additions & 19 deletions dash/orgs/migrations/0001_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions dash/tags/migrations/0001_squashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 19dc98f

Please sign in to comment.