Hi everyone, Just for letting you know that my 'created' and 'modified" fields are working with Datetime, Not Null and default set on None. It is working for every table except join tables as notices by Marcco, for example :
I have three tables as follow: categories, contacts, categories_contacts (join tables) All of them have a 'created' field which are automatically updated when a new entry is saved. But for the joi tables the SQL query is : INSERT INTO `categories_contacts` (`category_id`,`contact_id`) VALUES (12,'96') As you can see there is no 'created' fields. I supposed it is like this because for CakePHP developpers maybe join tables should only have two columns. So is it possible to use the core behavior and how? Otherwise, I can still add the datetime in the controller directly. Thanks for you help! On 13 mai, 21:25, Lucas Velasco <[email protected]> wrote: > Hi Brendon, > Same problem even after modifying the datetime field to Allow Null and > default to Null. > > Any ideas? > > Thanks. > > Lucas > > On May 8, 1:57 am, Brendon Kozlowski <[email protected]> wrote: > > > The `created` field must (1)be a datetime field, (2)NULL must be > > allowed, (3)and default to NULL value. Once that field is set as > > such, the magic behavior should begin working. > > > On May 7, 7:23 am, "[email protected]" > > > <[email protected]> wrote: > > > Hi > > > I have added "created" field to HABTM join tables, but when I try to > > > do a save I noted that this field aren't updated automatically. > > > Is it normal or that is some problem? > > > Many Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
