Fix silent failures on autoinc PK without an is_auto_increment attribute
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / ColumnObject.pm
1 package # Hide from PAUSE
2     ColumnObject;
3
4 use strict;
5 use warnings;
6
7 use base 'DBIC::Test::SQLite';
8 use Class::DBI::Column;
9
10 __PACKAGE__->set_table('column_object');
11
12 __PACKAGE__->columns( Primary => 'id' );
13 __PACKAGE__->columns( All => (
14   'id',
15   'columna',
16   'columnb',
17   Class::DBI::Column->new('columna' => {accessor => 'columna_as_read'}),
18   Class::DBI::Column->new('columnb' => {mutator  => 'columnb_as_write'}),
19 ));
20
21 # Disables the implicit autoinc-on-non-supplied-pk behavior
22 # (and the warning that goes with it)
23 # This is the same behavior as it was pre 0.082900
24 __PACKAGE__->column_info('id')->{is_auto_increment} = 0;
25
26 sub create_sql {
27   return qq{
28     id       INTEGER PRIMARY KEY,
29     columna  VARCHAR(20),
30     columnb  VARCHAR(20)
31   }
32 }
33
34 1;