Closed mflagler closed 3 months ago
The program doesn't have any 'real' understanding of what the primary and foreign tables are, so the 1
and n
labels are assigned first to the 'start table' and then to the 'end table'.
For example, here, since postId
references posts(id)
, the relationship gets created from postId
to id
. Comments
becomes the 'start table' and posts
becomes the 'end table'. So when you pick many-to-one, the comments
side gets n
and posts
- 1
.
At the end of the day, one-to-many and many-to-one are the same thing depending on which table you consider first.
Feel free to reopen the issue if you still have questions
Maybe I've always thought of it wrong, but wouldn't the cardinality of one to many indicate that I have 1 record in the table with the primary key to many records in the table with the foreign key? This is currently backwards, and I have to specify this as many to one, which seems backwards to me. Am I the only one thinking this?