Fix silent failures on autoinc PK without an is_auto_increment attribute
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / MyFoo.pm
CommitLineData
8273e845 1package # hide from PAUSE
c6d74d3e 2 MyFoo;
ea2e61bf 3
4a233f30 4use warnings;
5use strict;
6
ea2e61bf 7use base 'MyBase';
8
ea2e61bf 9__PACKAGE__->set_table();
10__PACKAGE__->columns(All => qw/myid name val tdate/);
11__PACKAGE__->has_a(
6a3bf251 12 tdate => 'Date::Simple',
13 inflate => sub { Date::Simple->new(shift) },
14 deflate => 'format',
ea2e61bf 15);
7305f6f9 16
17# Disables the implicit autoinc-on-non-supplied-pk behavior
18# (and the warning that goes with it)
19# This is the same behavior as it was pre 0.082900
20__PACKAGE__->column_info('myid')->{is_auto_increment} = 0;
21
d2cee1fa 22#__PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)");
ea2e61bf 23
24sub create_sql {
6a3bf251 25 return qq{
ea2e61bf 26 myid mediumint not null auto_increment primary key,
27 name varchar(50) not null default '',
28 val char(1) default 'A',
29 tdate date not null
30 };
31}
32
331;
34