X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FBasicRels.pm;h=161e8149b356ad65a01474472cf3d64da0330cac;hb=dc66dea1f99a1792a6dcf2027988966e78aa5923;hp=551d8b9063b0a40d99566e7ab25ad5910d075383;hpb=b3e8ac9b6c2b4b611b3f34f4024f64f352d8e9fa;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/BasicRels.pm b/t/lib/DBICTest/Schema/BasicRels.pm index 551d8b9..161e814 100644 --- a/t/lib/DBICTest/Schema/BasicRels.pm +++ b/t/lib/DBICTest/Schema/BasicRels.pm @@ -1,15 +1,17 @@ -package DBICTest::Schema::BasicRels; +package # hide from PAUSE + DBICTest::Schema::BasicRels; use base 'DBIx::Class::Core'; DBICTest::Schema::Artist->add_relationship( cds => 'DBICTest::Schema::CD', { 'foreign.artist' => 'self.artistid' }, - { order_by => 'year', join_type => 'LEFT', cascade_delete => 1 } + { order_by => 'year', join_type => 'LEFT', cascade_delete => 1, cascade_copy => 1, accessor => 'multi' } ); DBICTest::Schema::Artist->add_relationship( twokeys => 'DBICTest::Schema::TwoKeys', - { 'foreign.artist' => 'self.artistid' } + { 'foreign.artist' => 'self.artistid' }, + { cascade_copy => 1 } ); DBICTest::Schema::Artist->add_relationship( onekeys => 'DBICTest::Schema::OneKey', @@ -37,7 +39,7 @@ DBICTest::Schema::CD->add_relationship( DBICTest::Schema::CD->add_relationship( tags => 'DBICTest::Schema::Tag', { 'foreign.cd' => 'self.cdid' }, - { join_type => 'LEFT', cascade_delete => 1 } + { join_type => 'LEFT', cascade_delete => 1, cascade_copy => 1, accessor => 'multi', order_by => 'tag' } ); #DBICTest::Schema::CD->might_have(liner_notes => 'DBICTest::Schema::LinerNotes' => qw/notes/); DBICTest::Schema::CD->add_relationship( @@ -100,5 +102,6 @@ DBICTest::Schema::CD_to_Producer->add_relationship( # now the Helpers DBICTest::Schema::CD->many_to_many( 'producers', 'cd_to_producer', 'producer'); +DBICTest::Schema::CD->many_to_many( 'producers_sorted', 'cd_to_producer', 'producer', { order_by => 'producer.name' }); 1;