[Dbix-class] create_related is failing on second time through loop?

David Stevenson hoagy at ytfc.com
Thu Jun 21 20:59:53 GMT 2012


My money is on you not declaring your primary keys correctly - such that you ended up with detail_id as the primary key

What's the DB schema?

On 21 Jun 2012, at 21:41, Tim Anderson wrote:

> ...
> I am indeed setting a 'detail_id => 5' 2 times, but 'against' 2 different header records.   On loop 1, the primary key for the new detail record is 'header_id: 1, detail_id: 5' and on loop 2 it is 'header_id: 2, detail_id: 5'.  I probably wasn't clear enough in the last post that the detail table has header_id and detail_id as primary keys....



More information about the DBIx-Class mailing list