mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #29224 -- Fixed removing index_together indexes if exists unique_together constraint on the same fields.
This commit is contained in:
committed by
Mariusz Felisiak
parent
447980e72a
commit
533b208775
@@ -393,7 +393,12 @@ class BaseDatabaseSchemaEditor:
|
||||
news = {tuple(fields) for fields in new_index_together}
|
||||
# Deleted indexes
|
||||
for fields in olds.difference(news):
|
||||
self._delete_composed_index(model, fields, {'index': True}, self.sql_delete_index)
|
||||
self._delete_composed_index(
|
||||
model,
|
||||
fields,
|
||||
{'index': True, 'unique': False},
|
||||
self.sql_delete_index,
|
||||
)
|
||||
# Created indexes
|
||||
for field_names in news.difference(olds):
|
||||
fields = [model._meta.get_field(field) for field in field_names]
|
||||
|
||||
Reference in New Issue
Block a user