On 19 March 2012 12:33, Websuche :: Felix Ostmann <[email protected]> wrote:
> We run into the same problem and simple split the problem. Make a find, then
> update or create (simple look what update_or_create do internally)
>
> 2012/3/19 Will Crawford <[email protected]>
>>
>> change the value to \'CURRENT_TIMESTAMP' or \'CURRENT_DATE' :)
>
>
> read again ;) that was not the problem ...

Well, it might be a problem in the future (as in prepared statements
it'll get optimised to a fixed value; we had to change our code to use
CURRENT_TIMESTAMP instead of 'now'). But I see what you mean :) sorry.

You can fix it by adding the "key" attribute in the second parameter
to update_or_create, to tell it to use a different index (not one
including the date column) to search for the existing row.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to