Commit | Line | Data |
8273e845 |
1 | package # hide from PAUSE |
65c2b042 |
2 | DBICTest::Schema::BooksInLibrary; |
3 | |
4a233f30 |
4 | use warnings; |
5 | use strict; |
6 | |
65c2b042 |
7 | use base qw/DBICTest::BaseResult/; |
8 | |
9 | __PACKAGE__->table('books'); |
10 | __PACKAGE__->add_columns( |
11 | 'id' => { |
7305f6f9 |
12 | # part of a test (auto-retrieval of PK regardless of autoinc status) |
13 | # DO NOT define |
14 | #is_auto_increment => 1, |
15 | |
65c2b042 |
16 | data_type => 'integer', |
65c2b042 |
17 | }, |
18 | 'source' => { |
19 | data_type => 'varchar', |
20 | size => '100', |
21 | }, |
22 | 'owner' => { |
23 | data_type => 'integer', |
24 | }, |
25 | 'title' => { |
26 | data_type => 'varchar', |
27 | size => '100', |
28 | }, |
29 | 'price' => { |
30 | data_type => 'integer', |
31 | is_nullable => 1, |
32 | }, |
33 | ); |
34 | __PACKAGE__->set_primary_key('id'); |
35 | |
75f025cf |
36 | __PACKAGE__->add_unique_constraint (['title']); |
37 | |
65c2b042 |
38 | __PACKAGE__->resultset_attributes({where => { source => "Library" } }); |
39 | |
13a2f031 |
40 | __PACKAGE__->belongs_to ( owner => 'DBICTest::Schema::Owners', 'owner' ); |
41 | |
65c2b042 |
42 | 1; |