mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #28051 -- Made migrations respect Index's name argument.
Thanks Marc Tamlyn for the report and Tim Graham for the review.
This commit is contained in:
committed by
Tim Graham
parent
5d3b322dce
commit
d3cf75ec6f
@@ -446,7 +446,8 @@ class ModelState:
|
||||
elif name == "indexes":
|
||||
indexes = [idx.clone() for idx in model._meta.indexes]
|
||||
for index in indexes:
|
||||
index.set_name_with_model(model)
|
||||
if not index.name:
|
||||
index.set_name_with_model(model)
|
||||
options['indexes'] = indexes
|
||||
else:
|
||||
options[name] = model._meta.original_attrs[name]
|
||||
|
||||
Reference in New Issue
Block a user