Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Do cheaper check for column having a type.

  • Loading branch information...
commit 1a6d07783d980664312ce729e1fc8867ad1a3b5c 1 parent f0e09e2
Andrew Godwin authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/db/backends/schema.py
6  django/db/backends/schema.py
@@ -347,11 +347,11 @@ def delete_field(self, model, field):
347 347
         # Special-case implicit M2M tables
348 348
         if isinstance(field, ManyToManyField) and field.rel.through._meta.auto_created:
349 349
             return self.delete_model(field.rel.through)
350  
-        # Get the column's definition
351  
-        definition, params = self.column_sql(model, field)
352 350
         # It might not actually have a column behind it
353  
-        if definition is None:
  351
+        if field.db_parameters(connection=self.connection)['type'] is None:
354 352
             return
  353
+        # Get the column's definition
  354
+        definition, params = self.column_sql(model, field)
355 355
         # Delete the column
356 356
         sql = self.sql_delete_column % {
357 357
             "table": self.quote_name(model._meta.db_table),

0 notes on commit 1a6d077

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