| 1 | package DBIO::Test::Schema::BooksInLibrary; | ||
| 2 | # ABSTRACT: Test result class for the books table | ||
| 3 | |||
| 4 | 256 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 256 | our $VERSION = '0.900007'; | |
| 7 | |||
| 8 | 256 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 256 | ▶ | use base qw/DBIO::Test::BaseResult/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 256 | __PACKAGE__->table('books'); | |
| 13 | 256 | __PACKAGE__->add_columns( | |
| 14 | 'id' => { | ||
| 15 | # part of a test (auto-retrieval of PK regardless of autoinc status) | ||
| 16 | # DO NOT define | ||
| 17 | #is_auto_increment => 1, | ||
| 18 | |||
| 19 | data_type => 'integer', | ||
| 20 | }, | ||
| 21 | 'source' => { | ||
| 22 | data_type => 'varchar', | ||
| 23 | size => '100', | ||
| 24 | }, | ||
| 25 | 'owner' => { | ||
| 26 | data_type => 'integer', | ||
| 27 | }, | ||
| 28 | 'title' => { | ||
| 29 | data_type => 'varchar', | ||
| 30 | size => '100', | ||
| 31 | }, | ||
| 32 | 'price' => { | ||
| 33 | data_type => 'integer', | ||
| 34 | is_nullable => 1, | ||
| 35 | }, | ||
| 36 | ); | ||
| 37 | 256 | __PACKAGE__->set_primary_key('id'); | |
| 38 | |||
| 39 | 256 | __PACKAGE__->add_unique_constraint (['title']); | |
| 40 | |||
| 41 | 256 | __PACKAGE__->resultset_attributes({where => { source => "Library" } }); | |
| 42 | |||
| 43 | 256 | __PACKAGE__->belongs_to ( owner => 'DBIO::Test::Schema::Owners', 'owner' ); | |
| 44 | |||
| 45 | 256 | 1; | |
| 46 | |||
| 47 | __END__ | ||