Fix silent failures on autoinc PK without an is_auto_increment attribute
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / BooksInLibrary.pm
1 package # hide from PAUSE
2     DBICTest::Schema::BooksInLibrary;
3
4 use warnings;
5 use strict;
6
7 use base qw/DBICTest::BaseResult/;
8
9 __PACKAGE__->table('books');
10 __PACKAGE__->add_columns(
11   'id' => {
12     # part of a test (auto-retrieval of PK regardless of autoinc status)
13     # DO NOT define
14     #is_auto_increment => 1,
15
16     data_type => 'integer',
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
36 __PACKAGE__->add_unique_constraint (['title']);
37
38 __PACKAGE__->resultset_attributes({where => { source => "Library" } });
39
40 __PACKAGE__->belongs_to ( owner => 'DBICTest::Schema::Owners', 'owner' );
41
42 1;