Welcome Guest, Not a member yet? Register   Sign In
DataMapper And Tables Separated By Underscores?
#3

[eluser]Vheissu[/eluser]
Ah, thank you. That makes perfect sense. Question about the foreign key though, you mention it's the table name underscore ID. So if I have a 2 tables one called "products" and another called "product_categories" and have a join table called "products_product_categories". What foreign key name would DataMapper expect for "product_categories"? Would it expect "product_categorie" as the foreign key in the join table or could I use "product_category"?

Are there times like above where you need to tell the model what the foreign key is for each table so when you create join tables it knows? Sorry about all of the questions, just trying to learn the best way to do things with DataMapper, it's excellent.


Messages In This Thread
DataMapper And Tables Separated By Underscores? - by El Forum - 08-11-2011, 12:15 AM
DataMapper And Tables Separated By Underscores? - by El Forum - 08-11-2011, 06:40 AM
DataMapper And Tables Separated By Underscores? - by El Forum - 08-11-2011, 10:22 PM
DataMapper And Tables Separated By Underscores? - by El Forum - 08-12-2011, 02:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB