mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #34528 -- Reduced Add/RemoveIndex operations when optimizing migrations.
This commit is contained in:
@@ -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"),
|
||||
],
|
||||
[],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user