Topic: Setting Relationships
Hello,
I'm having a problem understanding how to set relationships. It should be pretty straightforward but I'm getting myself confused.
- I have 2 tables, one for Users and one for Housing
- Users can have many entries
- Housing can have multiple entries for each user (they may have lived in different places over time
- Do I set the relationship field in Users and have it point to Housing?
- or do I set the relationship field in Housing and have it point to Users?
- When I add a relationship field in Housing it asks me to "Select the parent table to Link"
- So when I do that the schema shows a one to many going from Users to Housing (if I'm reading that correctly?) This sounds correct to me?
- But in some of the code examples I've seen multiple relationship field entries in the main table (like my Users table) suggesting to me that Users is not always the parent table.
-
- In my application I'm going to have multiple tables with data that will belong to one of the entries in the User table.
-
- Like I said, I'm getting myself confused. Are there any rules or guidelines as how to set relationships for multiple tables?
-
- Thanks for your help, Frank