Changes between Version 1 and Version 2 of Ticket #33932, comment 6
- Timestamp:
- Aug 17, 2022, 5:39:28 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33932, comment 6
v1 v2 1 1 Great!, I created a regression test inspired by your migrations: 2 2 {{{#!diff 3 diff --git a/tests/schema/tests.py b/tests/schema/tests.py 4 index 9e2385f5d8..c5beb18304 100644 5 --- a/tests/schema/tests.py 6 +++ b/tests/schema/tests.py 7 @@ -1588,6 +1588,28 @@ class SchemaTests(TransactionTestCase): 8 # OneToOneField. 9 self.assertEqual(counts, {"fks": expected_fks, "uniques": 1, "indexes": 0}) 10 3 11 + def test_autofield_to_o2o(self): 4 12 + with connection.schema_editor() as editor: … … 22 30 + field_type, connection.features.introspected_field_types["IntegerField"] 23 31 + ) 24 32 + 33 def test_alter_field_fk_keeps_index(self): 34 with connection.schema_editor() as editor: 35 editor.create_model(Author) 25 36 }}}