X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FCD.pm;h=e0fa8fc0a8ca69571a0e3e02507cb8575c9818d6;hb=754cf88e231187af26e524a99130357fb5dbb500;hp=ec6ab24da3f5802fa1f73a40fae60a968543e8ea;hpb=660cf1be74795a5a5784f413741816413a724c1a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/CD.pm index ec6ab24..e0fa8fc 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/CD.pm @@ -3,7 +3,10 @@ package # hide from PAUSE use base qw/DBICTest::BaseResult/; -__PACKAGE__->table('cd'); +# this tests table name as scalar ref +# DO NOT REMOVE THE \ +__PACKAGE__->table(\'cd'); + __PACKAGE__->add_columns( 'cdid' => { data_type => 'integer', @@ -23,6 +26,7 @@ __PACKAGE__->add_columns( 'genreid' => { data_type => 'integer', is_nullable => 1, + accessor => undef, }, 'single_track' => { data_type => 'integer', @@ -36,6 +40,9 @@ __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { is_deferrable => 1, }); +__PACKAGE__->belongs_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', { + is_deferrable => 1, +}); # in case this is a single-cd it promotes a track from another cd __PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track', @@ -56,6 +63,7 @@ __PACKAGE__->might_have( { proxy => [ qw/notes/ ] }, ); __PACKAGE__->might_have(artwork => 'DBICTest::Schema::Artwork', 'cd_id'); +__PACKAGE__->has_one(mandatory_artwork => 'DBICTest::Schema::Artwork', 'cd_id'); __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' ); __PACKAGE__->many_to_many(