summaryrefslogtreecommitdiff
path: root/tests/schema
diff options
context:
space:
mode:
authorFiza Ashraf <68822806+fizaashraf37@users.noreply.github.com>2022-08-06 13:51:43 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-08-08 06:28:53 +0200
commitc0beff21239e70cbdcc9597e5be09e505bb8f76c (patch)
treef0d70c820f25a0f48472d4b27b6196a7fbf9e381 /tests/schema
parentfd93db97c7228b16a4f92f97ef05b0d72418d952 (diff)
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 'tests/schema')
-rw-r--r--tests/schema/tests.py11
1 files changed, 11 insertions, 0 deletions
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