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

Fixed #24972 -- Fixed removing unique_together indexes on MySQL.

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

View File

@@ -80,11 +80,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):