Ofcourse I could, but I don't like to repeat myself. If I have this
functionality in DB - I don't want to implement it in my scipts.

This is not about that I can not continue because of that cake behavior. I
can get a simple workaround working. This is more about concepts, principles
behind cake and undocumented(?) behaviors.

On 15 July 2010 06:33, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> I don't know if this would work for you and your set up, but could you
> populate and set the timestamp from within Cake using the date() function
> instead of relying on the database?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 15 Jul 2010, at 05:26, djogo wrote:
>
> >
> > 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 <grzegorzpaw...@gmail.com> 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 <waltherl...@gmail.com> 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 <grzegorzpaw...@gmail.com> 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Grzegorz Pawlik
695 146 983
grzegorzpaw...@gmail.com

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to