Supabase - The join table needs to have the foreign keys as part of its composite primary key. #9588
fuleihuang
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The 'relationship' type creates a join table with id as the primary key.
Is it possible to make the two foreign keys as primary keys?
Because it will be super convenient for supabase query the join table to get one-to-many data.
https://supabase.com/docs/reference/javascript/select --> Query referenced tables through a join table --> If you're in a situation where your tables are NOT directly related, but instead are joined by a join table, you can still use the select() method to query the related data. The join table needs to have the foreign keys as part of its composite primary key.
Thanks,
Fulei
Beta Was this translation helpful? Give feedback.
All reactions