mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-02 07:24:21 +02:00
parent
0fe3b38290
commit
e8f887ef4a
6 changed files with 64 additions and 0 deletions
|
|
@ -361,6 +361,16 @@ def test_add_foreign_key_guess_table(fresh_db):
|
|||
)
|
||||
|
||||
|
||||
def test_index_foreign_keys(fresh_db):
|
||||
test_add_foreign_key_guess_table(fresh_db)
|
||||
assert [] == fresh_db["dogs"].indexes
|
||||
fresh_db.index_foreign_keys()
|
||||
assert [["breed_id"]] == [i.columns for i in fresh_db["dogs"].indexes]
|
||||
# Calling it a second time should do nothing
|
||||
fresh_db.index_foreign_keys()
|
||||
assert [["breed_id"]] == [i.columns for i in fresh_db["dogs"].indexes]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"extra_data,expected_new_columns",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue