Loading django/db/backends/creation.py +28 −25 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ class BaseDatabaseCreation(object): output = ['%s %s;' % (style.SQL_KEYWORD('DROP TABLE'), style.SQL_TABLE(qn(model._meta.db_table)))] if model in references_to_delete: output.extend(self.sql_remove_table_constraints(model, references_to_delete)) output.extend(self.sql_remove_table_constraints(model, references_to_delete, style)) if model._meta.has_auto_field: ds = self.connection.ops.drop_sequence_sql(model._meta.db_table) Loading @@ -268,8 +268,11 @@ class BaseDatabaseCreation(object): output.append(ds) return output def sql_remove_table_constraints(self, model, references_to_delete): def sql_remove_table_constraints(self, model, references_to_delete, style): from django.db.backends.util import truncate_name output = [] qn = self.connection.ops.quote_name for rel_class, f in references_to_delete[model]: table = rel_class._meta.db_table col = f.column Loading Loading
django/db/backends/creation.py +28 −25 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ class BaseDatabaseCreation(object): output = ['%s %s;' % (style.SQL_KEYWORD('DROP TABLE'), style.SQL_TABLE(qn(model._meta.db_table)))] if model in references_to_delete: output.extend(self.sql_remove_table_constraints(model, references_to_delete)) output.extend(self.sql_remove_table_constraints(model, references_to_delete, style)) if model._meta.has_auto_field: ds = self.connection.ops.drop_sequence_sql(model._meta.db_table) Loading @@ -268,8 +268,11 @@ class BaseDatabaseCreation(object): output.append(ds) return output def sql_remove_table_constraints(self, model, references_to_delete): def sql_remove_table_constraints(self, model, references_to_delete, style): from django.db.backends.util import truncate_name output = [] qn = self.connection.ops.quote_name for rel_class, f in references_to_delete[model]: table = rel_class._meta.db_table col = f.column Loading