Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | MyFoo; |
ea2e61bf |
3 | |
4 | BEGIN { unshift @INC, './t/testlib'; } |
5 | use base 'MyBase'; |
6 | |
7 | use strict; |
8 | |
9 | __PACKAGE__->set_table(); |
10 | __PACKAGE__->columns(All => qw/myid name val tdate/); |
11 | __PACKAGE__->has_a( |
12 | tdate => 'Date::Simple', |
13 | inflate => sub { Date::Simple->new(shift) }, |
14 | deflate => 'format', |
15 | ); |
16 | __PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)"); |
17 | |
18 | sub create_sql { |
19 | return qq{ |
20 | myid mediumint not null auto_increment primary key, |
21 | name varchar(50) not null default '', |
22 | val char(1) default 'A', |
23 | tdate date not null |
24 | }; |
25 | } |
26 | |
27 | 1; |
28 | |