Commit | Line | Data |
a648ec78 |
1 | package # hide from PAUSE |
2 | DBICTest::Schema::Year2000CDs; |
bccd177f |
3 | ## Used in 104view.t |
a648ec78 |
4 | |
660cf1be |
5 | use base qw/DBICTest::BaseResult/; |
a648ec78 |
6 | |
030c27ad |
7 | __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); |
8 | |
084a2c0a |
9 | __PACKAGE__->table('year2000cds'); |
030c27ad |
10 | __PACKAGE__->result_source_instance->view_definition( |
11 | "SELECT cdid, artist, title FROM cd WHERE year ='2000'" |
12 | ); |
a648ec78 |
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; |