Dynamically load necessary table classes
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Year2000CDs.pm
1 package # hide from PAUSE 
2     DBICTest::Schema::Year2000CDs;
3 ## Used in 104view.t
4
5 use base qw/DBICTest::BaseResult/;
6
7 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
8
9 __PACKAGE__->table('year2000cds');
10 __PACKAGE__->result_source_instance->view_definition(
11   "SELECT cdid, artist, title FROM cd WHERE year ='2000'"
12 );
13 __PACKAGE__->add_columns(
14   'cdid' => {
15     data_type => 'integer',
16     is_auto_increment => 1,
17   },
18   'artist' => {
19     data_type => 'integer',
20   },
21   'title' => {
22     data_type => 'varchar',
23     size      => 100,
24   },
25
26 );
27 __PACKAGE__->set_primary_key('cdid');
28 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
29
30 1;