X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FArtistUndirectedMap.pm;h=c709572c8e5fac104aad81acddc3442c5ed86e19;hb=a97fe7e08bd7b821caec5f0093f52f4fbfdfcad6;hp=8e58312be254e71411bb0134945560ef4edfaba1;hpb=0009fa4905ab7f4585c4b470bfe049666bce8e17;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm index 8e58312..c709572 100644 --- a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm +++ b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm @@ -1,4 +1,5 @@ -package DBICTest::Schema::ArtistUndirectedMap; +package # hide from PAUSE + DBICTest::Schema::ArtistUndirectedMap; use base 'DBIx::Class::Core'; @@ -9,4 +10,11 @@ __PACKAGE__->add_columns( ); __PACKAGE__->set_primary_key(qw/id1 id2/); +__PACKAGE__->belongs_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} ); +__PACKAGE__->belongs_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => 'CASCADE'} ); +__PACKAGE__->has_many( + 'mapped_artists', 'DBICTest::Schema::Artist', + [ {'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'} ], +); + 1;