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/; |
030c27ad |
6 | use DBIx::Class::ResultSource::View; |
a648ec78 |
7 | |
030c27ad |
8 | __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); |
9 | |
084a2c0a |
10 | __PACKAGE__->table('year2000cds'); |
030c27ad |
11 | __PACKAGE__->result_source_instance->view_definition( |
12 | "SELECT cdid, artist, title FROM cd WHERE year ='2000'" |
13 | ); |
a648ec78 |
14 | __PACKAGE__->add_columns( |
15 | 'cdid' => { |
16 | data_type => 'integer', |
17 | is_auto_increment => 1, |
18 | }, |
19 | 'artist' => { |
20 | data_type => 'integer', |
21 | }, |
22 | 'title' => { |
23 | data_type => 'varchar', |
24 | size => 100, |
25 | }, |
26 | |
27 | ); |
28 | __PACKAGE__->set_primary_key('cdid'); |
29 | __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); |
30 | |
31 | 1; |