Ash FrameworkAF
Ash Frameworkโ€ข3y agoโ€ข
36 replies
dj_goku

Postgres Table(s)

I have a user resource and I need to assign a user to one_on_one resource. The one_on_one resource has two arguments user_1 and user_2. I am at a loss on how I should define the relationship. I know how I want the table design to be:

Where user_id_1 can't be the same as user_id_2. Anyone else struggle with this part of Ecto?
user:
- id
- name

one_on_one:
- user_id_1
- user_id_2
Was this page helpful?