Fixed #33899 -- Fixed migration crash when removing indexed field on SQLite 3.35.5+.

Regression in 702819227fd0cdd9b581cd99e11d1561d51cbeb.

Thanks cessor for the report.
This commit is contained in:
Fiza Ashraf 2022-08-06 13:51:43 -07:00 committed by Mariusz Felisiak
parent fd93db97c7
commit c0beff2123
4 changed files with 18 additions and 2 deletions

View file

@ -813,6 +813,17 @@ class SchemaTests(TransactionTestCase):
False,
)
def test_remove_indexed_field(self):
with connection.schema_editor() as editor:
editor.create_model(AuthorCharFieldWithIndex)
with connection.schema_editor() as editor:
editor.remove_field(
AuthorCharFieldWithIndex,
AuthorCharFieldWithIndex._meta.get_field("char_field"),
)
columns = self.column_classes(AuthorCharFieldWithIndex)
self.assertNotIn("char_field", columns)
def test_alter(self):
"""
Tests simple altering of fields