mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-28 12:54:15 +02:00
Fixed dumb bug I just introduced
This commit is contained in:
parent
7396d085fe
commit
1c6973baa8
1 changed files with 5 additions and 2 deletions
|
|
@ -783,8 +783,11 @@ class Database:
|
||||||
3,
|
3,
|
||||||
4,
|
4,
|
||||||
), "foreign_keys= should be a list of tuple pairs or triples"
|
), "foreign_keys= should be a list of tuple pairs or triples"
|
||||||
if len(tuple_or_list) == 3:
|
if len(tuple_or_list) in (3, 4):
|
||||||
tuple_or_list = cast(Tuple[str, str, str], tuple_or_list)
|
if len(tuple_or_list) == 4:
|
||||||
|
tuple_or_list = cast(Tuple[str, str, str], tuple_or_list[1:])
|
||||||
|
else:
|
||||||
|
tuple_or_list = cast(Tuple[str, str, str], tuple_or_list)
|
||||||
fks.append(
|
fks.append(
|
||||||
ForeignKey(
|
ForeignKey(
|
||||||
name, tuple_or_list[0], tuple_or_list[1], tuple_or_list[2]
|
name, tuple_or_list[0], tuple_or_list[1], tuple_or_list[2]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue