1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #34528 -- Reduced Add/RemoveIndex operations when optimizing migrations.

This commit is contained in:
Mariusz Felisiak
2023-05-01 18:57:24 +02:00
committed by GitHub
parent 0b0998dc15
commit 191f6a9a45
2 changed files with 19 additions and 0 deletions

View File

@@ -1158,3 +1158,17 @@ class OptimizerTests(SimpleTestCase):
),
]
)
def test_add_remove_index(self):
self.assertOptimizesTo(
[
migrations.AddIndex(
"Pony",
models.Index(
fields=["weight", "pink"], name="idx_pony_weight_pink"
),
),
migrations.RemoveIndex("Pony", "idx_pony_weight_pink"),
],
[],
)