Yes, this kind of suck. I wanted to have both created_at and
updated_at fields, which I remember being trivial at mysql, but cake
doesnt allow you to:

- have two or more timestamp fields
- name your timestamp field whatever you want




On 13 jul, 04:11, Grzegorz Pawlik <[email protected]> wrote:
> That's not what I'm asking about. Lets say I NEED to use TIMESTAMP and
> CURRENT_TIMESTAMP as default value, and in that case cakePHP
> misbehaves.
>
> On Jul 13, 7:04 am, Walther <[email protected]> wrote:
>
>
>
> > I've never seen that problem before...
>
> > Cake offers the same functionality, it is well documented in every
> > book. Basically you crater a field called created or updated as a
> > datetime, default null and cake will populate it automatically.
>
> > On Jul 12, 5:02 pm, Grzegorz Pawlik <[email protected]> wrote:
>
> > > just switching from 1.3.0 to 1.3.2 got me into trouble, when I have
> > > field specified as:
>
> > >   `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
>
> > > and don't supply any value for that field in array I try to save ,
> > > neither a key in
> > > 1.3.0 it's working as desired - I get current timestamp in that field,
> > > but
> > > 1.3.2 tries looks that's it not null field, and read default value
> > > (CURRENT_TIMESTAMP) ant unfortunatelly polupulates this array with
> > > that pair of key/val:
> > > "createt_at"=>"CURRENT_TIMESTAMP"
> > > which is basically stupid for two reasons, I think:
> > > 1. It tries to duplicate database mechanisms which are working just
> > > fine (when no value - use default value, no need to to that:
> > > if no value, check what's default value defined in database and
> > > explicitly save data with that value)
> > > 2. It makes CURRENT_TIMESTAMP not working
>
> > > is there a way to turn that behavior off?

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

Reply via email to