Skip to content

Commit 01448c3

Browse files
authored
Merge pull request #30 from financica/master
Fix backwards migration not running after refactor
2 parents 6daaf2d + 3b9602e commit 01448c3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

postgres_composite_types/operations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ def database_forwards(self, app_label, schema_editor, from_state, to_state):
4747
)
4848

4949
def database_backwards(self, app_label, schema_editor, from_state, to_state):
50-
return sql_drop_type(self.Meta.db_type, schema_editor=schema_editor)
50+
schema_editor.execute(
51+
sql_drop_type(self.Meta.db_type, schema_editor=schema_editor)
52+
)

tests/test_field.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def test_migration(self):
8484

8585
# Run the migration forwards to create the type again
8686
migrate(self.migrate_to)
87+
self.assertTrue(does_type_exist(SimpleType._meta.db_type))
8788

8889
# The signal should have been sent
8990
self.assertEqual(signal_func.call_count, 1)

0 commit comments

Comments
 (0)