Commit | Line | Data |
8273e845 |
1 | package # hide from PAUSE |
c6d74d3e |
2 | MyFoo; |
ea2e61bf |
3 | |
4a233f30 |
4 | use warnings; |
5 | use strict; |
6 | |
ea2e61bf |
7 | use 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 | |
24 | sub 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 | |
33 | 1; |
34 | |