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