Ticket #3480: 3480.diff
File 3480.diff, 1.6 KB (added by , 17 years ago) |
---|
-
django/core/management/sql.py
116 116 "Returns a list of the DROP TABLE SQL statements for the given app." 117 117 from django.db import connection, models, get_introspection_module 118 118 from django.db.backends.util import truncate_name 119 from django.contrib.contenttypes import generic 119 120 introspection = get_introspection_module() 120 121 121 122 # This should work even if a connection isn't available … … 179 180 for model in app_models: 180 181 opts = model._meta 181 182 for f in opts.many_to_many: 182 if cursor and table_name_converter(f.m2m_db_table()) in table_names: 183 output.append("%s %s;" % (style.SQL_KEYWORD('DROP TABLE'), 184 style.SQL_TABLE(qn(f.m2m_db_table())))) 185 ds = connection.ops.drop_sequence_sql("%s_%s" % (model._meta.db_table, f.column)) 186 if ds: 187 output.append(ds) 183 if not isinstance(f.rel, generic.GenericRel): 184 if cursor and table_name_converter(f.m2m_db_table()) in table_names: 185 output.append("%s %s;" % (style.SQL_KEYWORD('DROP TABLE'), 186 style.SQL_TABLE(qn(f.m2m_db_table())))) 187 ds = connection.ops.drop_sequence_sql("%s_%s" % (model._meta.db_table, f.column)) 188 if ds: 189 output.append(ds) 188 190 189 191 app_label = app_models[0]._meta.app_label 190 192