Commit 1a6d0778 authored by Andrew Godwin's avatar Andrew Godwin
Browse files

Do cheaper check for column having a type.

parent f0e09e27
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -347,11 +347,11 @@ class BaseDatabaseSchemaEditor(object):
        # 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),