From c0beff21239e70cbdcc9597e5be09e505bb8f76c Mon Sep 17 00:00:00 2001 From: Fiza Ashraf <68822806+fizaashraf37@users.noreply.github.com> Date: Sat, 6 Aug 2022 13:51:43 -0700 Subject: Fixed #33899 -- Fixed migration crash when removing indexed field on SQLite 3.35.5+. Regression in 702819227fd0cdd9b581cd99e11d1561d51cbeb. Thanks cessor for the report. --- tests/schema/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 0702b54135..a72e6906bb 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -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 -- cgit v1.3