[Dbix-class] DBIx::Class::Schema::Loader - unique_constraints?

Adam Sjøgren asjo at koldfront.dk
Mon Mar 6 13:08:18 CET 2006


  Hi.


I'm having problems with using the update_or_create-method¹ - it seems
to boil down to DBIx::Class not knowing that I have a
UNIQUE-declaration in addition to the PRIMARY KEY on the table in
question.

When I dump the %unique_constraints in ResultSet::update_or_create,
only the primary key is listed - which brings me to the question:

Is DBIx::Class::Schema::Loader supposed to figure out the
unique_constraints by itself, or should I configure them somehow?


(I'm using PostgreSQL).


  Best regards,

    Adam


¹ When I call update_or_create with values that uniquely identify an
  existing row (but now with any value for the primary key),
  DBIx::Class tries to insert instead of update - resulting in the
  database throwing an error, as the new row violates the UNIQUEness.

-- 
 "You have to photosynthesize"                                Adam Sjøgren
                                                         asjo at koldfront.dk




More information about the Dbix-class mailing list