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 | ||
971bc4b6 | 9 | use Date::Simple 3.03; |
10 | ||
ea2e61bf | 11 | __PACKAGE__->set_table(); |
12 | __PACKAGE__->columns(All => qw/myid name val tdate/); | |
13 | __PACKAGE__->has_a( | |
6a3bf251 | 14 | tdate => 'Date::Simple', |
15 | inflate => sub { Date::Simple->new(shift) }, | |
16 | deflate => 'format', | |
ea2e61bf | 17 | ); |
d2cee1fa | 18 | #__PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)"); |
ea2e61bf | 19 | |
20 | sub create_sql { | |
6a3bf251 | 21 | return qq{ |
ea2e61bf | 22 | myid mediumint not null auto_increment primary key, |
23 | name varchar(50) not null default '', | |
24 | val char(1) default 'A', | |
25 | tdate date not null | |
26 | }; | |
27 | } | |
28 | ||
29 | 1; | |
30 |