diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/sqlite3/schema.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 55fdf5fbfe..6c106ae868 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -408,10 +408,11 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): # For explicit "through" M2M fields, do nothing elif ( self.connection.features.can_alter_table_drop_column - # Primary keys, unique fields, and foreign keys are not - # supported in ALTER TABLE DROP COLUMN. + # Primary keys, unique fields, indexed fields, and foreign keys are + # not supported in ALTER TABLE DROP COLUMN. and not field.primary_key and not field.unique + and not field.db_index and not (field.remote_field and field.db_constraint) ): super().remove_field(model, field) |
