In my opinion, you let the database do what it does best, managing data, and that includes all the constraints/rules between entities/ tables. I would never let CakePHP handle my cascade operations!
Example with posts and comments. It is obvious that comments can't have a life of their own without the posts, so the foreign key will be defined with cascade delete on parent delete. Indexes: Usually I only create additional indexes after the application is developed and testing is started. Find out where the bottlenecks are and add indexes where necessary. My 2 santims ;) John On May 12, 6:19 am, "Dave Maharaj :: WidePixels.com" <[email protected]> wrote: > When building an app is it necessary to define additional PRIMARY KEY ( `id` > ) , INDEX keys in the database? Is it best to use the FOREIGN KEY references > with CASCADE and all of that within the database even though Cake can take > care of most of that or just setting the PRIMARY KEY is all that is needed? > > Dave --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
