Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do cheaper check for column having a type.

  • Loading branch information...
commit 1a6d07783d980664312ce729e1fc8867ad1a3b5c 1 parent f0e09e2
@andrewgodwin andrewgodwin authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/db/backends/schema.py
View
6 django/db/backends/schema.py
@@ -347,11 +347,11 @@ def delete_field(self, model, field):
# Special-case implicit M2M tables
if isinstance(field, ManyToManyField) and field.rel.through._meta.auto_created:
return self.delete_model(field.rel.through)
- # Get the column's definition
- definition, params = self.column_sql(model, field)
# It might not actually have a column behind it
- if definition is None:
+ if field.db_parameters(connection=self.connection)['type'] is None:
return
+ # Get the column's definition
+ definition, params = self.column_sql(model, field)
# Delete the column
sql = self.sql_delete_column % {
"table": self.quote_name(model._meta.db_table),

0 comments on commit 1a6d077

Please sign in to comment.
Something went wrong with that request. Please try again.