X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FDBSchema%2FResult%2FDvd.pm;h=b355e52655c7feaf723d85d34e4a8fc94b09428a;hp=ba34eecc6c9c1ae98e761fe87f26658b92d68324;hb=45d3acef815c1fb052b317bc81bb7470a34cde30;hpb=3e2e533e6a5cd7953a5e3c5c22e787da7e4451c1 diff --git a/t/lib/DBSchema/Result/Dvd.pm b/t/lib/DBSchema/Result/Dvd.pm index ba34eec..b355e52 100644 --- a/t/lib/DBSchema/Result/Dvd.pm +++ b/t/lib/DBSchema/Result/Dvd.pm @@ -45,8 +45,10 @@ __PACKAGE__->add_columns( }, ); __PACKAGE__->set_primary_key('dvd_id'); -__PACKAGE__->belongs_to('owner', 'DBSchema::Result::User', { id => 'owner' }); -__PACKAGE__->belongs_to('current_borrower', 'DBSchema::Result::User', { id => 'current_borrower' }); +__PACKAGE__->add_unique_constraint(dvd_name => [qw(name)]); +__PACKAGE__->add_unique_constraint(dvd_twokeys => [qw(twokeysfk)]); +__PACKAGE__->belongs_to('owner', 'DBSchema::Result::User', 'owner'); +__PACKAGE__->belongs_to('current_borrower', 'DBSchema::Result::User', 'current_borrower', { join_type => "LEFT" }); __PACKAGE__->has_many('dvdtags', 'Dvdtag', { 'foreign.dvd' => 'self.dvd_id' }); __PACKAGE__->has_many('viewings', 'DBSchema::Result::Viewing', { 'foreign.dvd_id' => 'self.dvd_id' }); __PACKAGE__->many_to_many('tags', 'dvdtags' => 'tag');