X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FViewDeps%2FResult%2FYear2010CDsWithManyTracks.pm;fp=t%2Flib%2FViewDeps%2FResult%2FYear2010CDsWithManyTracks.pm;h=c6e4144fbd0ddc39fc3a3081510d331ba1340c57;hb=fe0708a2d68b5d34b6bc6f7e70164c3e569f1dd0;hp=0000000000000000000000000000000000000000;hpb=01272eb81fe3a43e0a2f7befa465cc669945d543;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm b/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm new file mode 100644 index 0000000..c6e4144 --- /dev/null +++ b/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm @@ -0,0 +1,36 @@ +package # hide from PAUSE + ViewDeps::Result::Year2010CDsWithManyTracks; + +use strict; +use warnings; +use base 'ViewDeps::Result::Year2010CDs'; + +__PACKAGE__->table_class('DBIx::Class::ResultSource::View'); +__PACKAGE__->table('year_2010_cds_with_many_tracks'); +__PACKAGE__->result_source_instance->view_definition( + "SELECT cd.id,cd.title,cd.artist,cd.year,cd.number_tracks,art.file FROM year_2010_cds cd JOIN artwork art on art.cd = cd.id WHERE cd.number_tracks > 10" +); + +__PACKAGE__->result_source_instance->deploy_depends_on( + ["ViewDeps::Result::Year2010CDs"] ); + +__PACKAGE__->add_columns( + id => { data_type => 'integer', is_auto_increment => 1 }, + title => { data_type => 'text' }, + artist => { data_type => 'integer', is_nullable => 0 }, + year => { data_type => 'integer' }, + number_tracks => { data_type => 'integer' }, + file => { data_type => 'integer' }, +); + +__PACKAGE__->set_primary_key('id'); + +__PACKAGE__->belongs_to( 'artist', 'ViewDeps::Result::Artist', + { "foreign.id" => "self.artist" }, +); + +__PACKAGE__->has_many( 'tracks', 'ViewDeps::Result::Track', + { "foreign.cd" => "self.id" }, +); + +1;