X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FCD.pm;h=552f16e0b8f5119943a78d4753364ae723dc3492;hb=97c96475;hp=513dd65bf9fe7b3ac69a50f8c4145b4ea73403da;hpb=56b73f831fd0eef1327e47e6aa39b4c3e876142d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/CD.pm index 513dd65..552f16e 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/CD.pm @@ -1,9 +1,12 @@ package # hide from PAUSE DBICTest::Schema::CD; -use base 'DBIx::Class::Core'; +use base qw/DBICTest::BaseResult/; + +# this tests table name as scalar ref +# DO NOT REMOVE THE \ +__PACKAGE__->table(\'cd'); -__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', @@ -35,6 +39,10 @@ __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { is_deferrable => 1, + proxy => { artist_name => 'name' }, +}); +__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 @@ -56,6 +64,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(