1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #27165 -- Removed unnecessary CreateModel(... 'indexes': []) in migrations.

This commit is contained in:
akki
2016-09-19 19:47:16 +05:30
committed by Tim Graham
parent 9023f25278
commit 358c6f21f8
2 changed files with 4 additions and 8 deletions

View File

@@ -529,10 +529,8 @@ class MigrationAutodetector(object):
related_fields[field.name] = field
if getattr(field.remote_field, "through", None) and not field.remote_field.through._meta.auto_created:
related_fields[field.name] = field
# Are there any indexes to defer?
indexes = model_state.options['indexes']
model_state.options['indexes'] = []
# Are there unique/index_together to defer?
# Are there indexes/unique|index_together to defer?
indexes = model_state.options.pop('indexes')
unique_together = model_state.options.pop('unique_together', None)
index_together = model_state.options.pop('index_together', None)
order_with_respect_to = model_state.options.pop('order_with_respect_to', None)