﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33710	RenameIndex() crashes when unnamed index is moving backward and forward.	Mariusz Felisiak	David Wobrock	"`RenameIndex()` should restore the old auto-generated name when an unnamed index for `unique_together` is moving backward. Now re-applying `RenameIndex()` crashes. For example:
{{{#!diff
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index cfd28b1b39..c0a55023bb 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -2988,6 +2988,10 @@ 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"")
+        # Re-apply renaming.
+        with connection.schema_editor() as editor:
+            operation.database_forwards(app_label, editor, project_state, new_state)
+        self.assertIndexNameExists(table_name, ""new_pony_test_idx"")
         # Deconstruction.
         definition = operation.deconstruct()
         self.assertEqual(definition[0], ""RenameIndex"")
}}}
crashes on PostgreSQL:
{{{
django.db.utils.ProgrammingError: relation ""new_pony_test_idx"" already exists
}}}"	Bug	closed	Migrations	dev	Release blocker	fixed		David Wobrock	Ready for checkin	1	0	0	0	0	0
