It depends if you will need to model the join table in the near future,
since CakePHP doesn't support multiple primary key fields. If you need, then
adding an ID is a must.

If you don't, you could go with both fields as primary keys.

But since it doesn't hurt to add an extra ID column, and with it you can
prepare if you ever need to query the join table, then I would say add the
primary key anyway.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de codingisfun
Enviado el: Lunes, 12 de Marzo de 2007 09:48 a.m.
Para: Cake PHP
Asunto: primary key in de jointable of a habtm assocation

What is the recommended way to define the primary key in a join table
for the habtm associations? Should i use the combination of the
foreign-keys as primary key or should i create an extra id column.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to