Hi Larry,

Sorry I just found your reply in my inbox now for some strange reason so sorry for the delay. Thanks for your reply.

On 7/18/06, Larry E. Masters aka PhpNut <[EMAIL PROTECTED]> wrote:
Sonic,

Why on earth would you have composite keys in your database tables?

Well, in a HABTM link table where I want to have extra fields.

Book HABTM Author

Author table:

id       |         Author       |    foo    |     bar
-------+--------------------+---------+-----------
123    |    J.R.R Tolkeen   |    bla    |     bla


Book table:

id       |         Book       |    foo    |     bar
-------+------------------+---------+--------------
abc    |     The Hobbit  |     bla   |     bla  

authors_books table:

author_id |    book_id     |     format
------------+----------------+-------------------
123          |      abc          |    Paper Back
123          |      abc          |    Hard Back


I know you're thinking just add and 'id' field and that'll solve the problem but won't that add an extra index, (and therefore use more resources), or is the effect of this neglegable these days?
It just seems like an unnecessary extra field to me, but that's just my opinion (probably influenced by Tony's article when I was learning about this stuff).


And Tony Marston is the last person I would be reading for advice on how to do anything related to application development, aside from the point he has been developing 1st 2nd 3rd 4th 5th and so on generation applications and make sure to mention it in every post he has ever commented on in numerous forums.

I've noticed his tendancy to do that :-)

Cheers,

Psychie.

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

Reply via email to