diff options
author | Fiza Ashraf <68822806+fizaashraf37@users.noreply.github.com> | 2022-08-06 13:51:43 -0700 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-08-08 06:28:53 +0200 |
commit | c0beff21239e70cbdcc9597e5be09e505bb8f76c (patch) | |
tree | f0d70c820f25a0f48472d4b27b6196a7fbf9e381 /django/db/backends/sqlite3/schema.py | |
parent | fd93db97c7228b16a4f92f97ef05b0d72418d952 (diff) | |
download | django-c0beff21239e70cbdcc9597e5be09e505bb8f76c.tar.gz |
Fixed #33899 -- Fixed migration crash when removing indexed field on SQLite 3.35.5+.
Regression in 702819227fd0cdd9b581cd99e11d1561d51cbeb.
Thanks cessor for the report.
Diffstat (limited to 'django/db/backends/sqlite3/schema.py')
-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) |