Displaying 1 result from an estimated 1 matches for "closed_by".
Did you mean:
closed_at
2005 Dec 14
5
belongs_to and multiple foreign keys
Hi all,
I''m confused about how I''m supposed to specify a belongs_to relationship when
the table includes multiple columns that reference the same parent table.
In my case I have a "schedules" table with "opened_by" and "closed_by" columns,
that both reference the "users" table. In theory, they can be two different
user ids.
table schedules (
...
opened_by int,
closed_by int,
foreign key (closed_by) references users (id),
foreign key (opened_by) references users (id)
);
Do I simply spe...