Replies: 2 comments 3 replies
-
Seems to be solved in https://stackoverflow.com/questions/26965983/sqlalchemy-ambiguousforeignkeyserror
you can pass that primaryjoin param by using sqlmodel relationship sa_kwargs like there, https://stackoverflow.com/questions/71464757/what-does-sa-relationship-kwargs-lazy-selectin-means-on-sqlmodel-with-f
|
Beta Was this translation helpful? Give feedback.
2 replies
-
I fixed it with this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I am trying to link 2 BankAccount IDs on a single table (i.e. BankTransaction & AppTransaction)
How do I properly link a bank account ID twice on a single table?
I am currently getting this error:
sqlalchemy.exc.AmbiguousForeignKeysError: Could not determine join condition between parent/child tables on relationship BankAccount.bank_account_to_bank_transactions - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table.
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
Python 3.11.5
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions