1 package # hide from PAUSE
2 DBICTest::Schema::Year1999CDs;
5 use base qw/DBICTest::BaseResult/;
7 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
9 __PACKAGE__->table('year1999cds');
10 __PACKAGE__->result_source_instance->is_virtual(1);
11 __PACKAGE__->result_source_instance->view_definition(
12 "SELECT cdid, artist, title, single_track FROM cd WHERE year ='1999'"
14 __PACKAGE__->add_columns(
16 data_type => 'integer',
17 is_auto_increment => 1,
20 data_type => 'integer',
23 data_type => 'varchar',
27 data_type => 'integer',
32 __PACKAGE__->set_primary_key('cdid');
33 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
35 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
36 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
37 { "foreign.cd" => "self.cdid" });