mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #35022 -- Fixed RenameIndex() crash on unnamed indexes if exists unique constraint on the same fields.
This commit is contained in:
committed by
Mariusz Felisiak
parent
6c08dba517
commit
7045661069
@@ -1017,7 +1017,10 @@ class RenameIndex(IndexOperation):
|
||||
from_model._meta.get_field(field).column for field in self.old_fields
|
||||
]
|
||||
matching_index_name = schema_editor._constraint_names(
|
||||
from_model, column_names=columns, index=True
|
||||
from_model,
|
||||
column_names=columns,
|
||||
index=True,
|
||||
unique=False,
|
||||
)
|
||||
if len(matching_index_name) != 1:
|
||||
raise ValueError(
|
||||
|
||||
Reference in New Issue
Block a user