On Tue, Feb 17, 2009 at 4:58 PM, Dermot <[email protected]> wrote:
> 2009/2/17 Zbigniew Lukasiak <[email protected]>:
>
>>
>> I don't know about the error you are getting now - but 'id => undef'
>> is also not quite correct here - because create will then try to
>> create a NULL id (which is presumably your primary key) - and this
>> will fail on many databases.
>
> So what I should I pass to 'id', nothing?

Yeah - this is the problem.  The official answer is that you should
not use find_or_create on tables with auto-increment pks - you should
use 'create' or 'find' as appriopriate instead.


-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/

_______________________________________________
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