mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #33710 -- Made RenameIndex operation a noop when the old and new name match.
This commit is contained in:
committed by
Mariusz Felisiak
parent
647480166b
commit
11310e9abb
@@ -2988,6 +2988,11 @@ class OperationTests(OperationTestBase):
|
||||
with connection.schema_editor() as editor, self.assertNumQueries(0):
|
||||
operation.database_backwards(app_label, editor, new_state, project_state)
|
||||
self.assertIndexNameExists(table_name, "new_pony_test_idx")
|
||||
# Reapply, RenameIndex operation is a noop when the old and new name
|
||||
# match.
|
||||
with connection.schema_editor() as editor:
|
||||
operation.database_forwards(app_label, editor, new_state, project_state)
|
||||
self.assertIndexNameExists(table_name, "new_pony_test_idx")
|
||||
# Deconstruction.
|
||||
definition = operation.deconstruct()
|
||||
self.assertEqual(definition[0], "RenameIndex")
|
||||
|
||||
Reference in New Issue
Block a user