Simplify drop-foreign-key, and drop_foreign_keys, closes #177

This commit is contained in:
Simon Willison 2020-09-24 09:19:07 -07:00
commit 5a63b9e88c
6 changed files with 6 additions and 18 deletions

View file

@ -274,12 +274,7 @@ def test_transform_drop_foreign_keys(fresh_db, use_pragma_foreign_keys):
),
]
# Drop two of those foreign keys
fresh_db["places"].transform(
drop_foreign_keys=(
("country", "country", "id"),
("continent", "continent", "id"),
)
)
fresh_db["places"].transform(drop_foreign_keys=("country", "continent"))
# Should be only one foreign key now
assert fresh_db["places"].foreign_keys == [
ForeignKey(table="places", column="city", other_table="city", other_column="id")