[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]J101[/eluser]
[quote author="OverZealous.com" date="1242032838"]Yes it relates on ids. I don't understand why that is a question.[/quote] Well, I asked because the code I am looking at does not have any reference to id columns and it made me wonder why, that was why I asked. [quote author="OverZealous.com" date="1242032838"]As it says in the documentation, every table must have a primary key named id. What else would you join two tables on?[/quote] Exactly. [quote author="OverZealous.com" date="1242032838"]Your join table is wrong in your example. It should be: Quote:address_users[/quote] Actually, I made a mistake. I originally started to relate two tables called table1 and table2 but missed changing them later when I decided to make a M:M relationship. [quote author="OverZealous.com" date="1242032838"]There really isn't two sets of documentation. I've taken the base DataMapper and added a few features. The only really important thing (regarding databases) that changed was that I allow 1-to-N relationships to use in-table relationships (In the example above, assume addresses can only have one user. Then you could include user_id on the addresses table directly.). If you don't use that or the more complex many-to-many relationships, just use DataMapper as it is.[/quote] OK, this is good to know. Thanks. I was having a hard time sorting out what belonged to him and what you did. One thing that I see that you did was by allowing the 1-to-N relationships, you have cut way down on the number of tables that are needed and that's a good thing. Thanks for the clairification! ![]() |
Welcome Guest, Not a member yet? Register Sign In |