Change API of deploy_depends_on: pass it source names. Fix optional deps on 105view_d...
[dbsrgits/DBIx-Class.git] / t / lib / ViewDepsBad / Result / Year2010CDsWithManyTracks.pm
CommitLineData
51b31bbe 1package # hide from PAUSE
2 ViewDepsBad::Result::Year2010CDsWithManyTracks;
3
4use strict;
5use warnings;
6use base 'ViewDepsBad::Result::Year2010CDs';
7
8__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
9__PACKAGE__->table('year_2010_cds_with_many_tracks');
10__PACKAGE__->result_source_instance->view_definition(
11 "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"
12);
13
14__PACKAGE__->result_source_instance->deploy_depends_on(
7c4ade2a 15 ["Year2010CDs"] );
51b31bbe 16
17__PACKAGE__->add_columns(
18 id => { data_type => 'integer', is_auto_increment => 1 },
19 title => { data_type => 'text' },
20 artist => { data_type => 'integer', is_nullable => 0 },
21 year => { data_type => 'integer' },
22 number_tracks => { data_type => 'integer' },
23 file => { data_type => 'integer' },
24);
25
26__PACKAGE__->set_primary_key('id');
27
28__PACKAGE__->belongs_to( 'artist', 'ViewDepsBad::Result::Artist',
29 { "foreign.id" => "self.artist" },
30);
31
32__PACKAGE__->has_many( 'tracks', 'ViewDepsBad::Result::Track',
33 { "foreign.cd" => "self.id" },
34);
35
361;