I absolutely endorse a single, incremental, non-intelligent primary key, enriched with multi-field unique indexes and the adoption of convention. Why make life any more difficult than it is already?
Jeremy Burns [email protected] On 16 Apr 2010, at 21:29, Renan Augusto wrote: > Dear, > > Someone must have encountered a situation where a table had > with composite key. > what did you do? Since CakePHP recognizes only one field to > primaryKey! > > In my opinion I see two possibilities: > > 1 - not create tables with composite keys. When you need to use > composite keys to identify a record, create one more field with the > name ID and put it as primary key. > > 2 - forget standardization. Choose one of the fields to put in > $ primaryKey attribute of the model and when you need to make a > relationship (or hasMany belongsTo), use to specify the conditions > other fields that make up the key of the table. > > That's my opinion, please tell her! > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" 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 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" 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
