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

[1.8.x] Fixed #24972 -- Fixed removing unique_together indexes on MySQL.

Backport of 65296b3be3 from master
This commit is contained in:
Adam Brenecki
2015-06-12 15:52:08 +09:30
committed by Tim Graham
parent c58755d875
commit 0e3a80fa68
4 changed files with 38 additions and 6 deletions

View File

@@ -73,11 +73,9 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
"""
first_field = model._meta.get_field(fields[0])
if first_field.get_internal_type() == 'ForeignKey':
constraint_names = self._constraint_names(model, fields[0], index=True)
constraint_names = self._constraint_names(model, [first_field.column], index=True)
if not constraint_names:
self.execute(
self._create_index_sql(model, [model._meta.get_field(fields[0])], suffix="")
)
self.execute(self._create_index_sql(model, [first_field], suffix=""))
return super(DatabaseSchemaEditor, self)._delete_composed_index(model, fields, *args)
def _set_field_new_type_null_status(self, field, new_type):