6 use base qw( DBIx::Class );
8 __PACKAGE__->load_components( qw( DateTime::Epoch TimeStamp Core ) );
9 __PACKAGE__->table( 'foo' );
10 __PACKAGE__->add_columns(
12 data_type => 'bigint',
13 is_auto_increment => 1,
17 data_type => 'varchar',
21 bar => { # epoch stored as an int
22 data_type => 'bigint',
23 inflate_datetime => 1,
25 baz => { # epoch stored as a string
26 data_type => 'varchar',
28 inflate_datetime => 'epoch',
30 dt => { # regular datetime field -- should not conflict
31 data_type => 'datetime',
32 inflate_datetime => 1,
34 # working in conjunction with DBIx::Class::TimeStamp
36 data_type => 'bigint',
37 inflate_datetime => 1,
40 modification_time => {
41 data_type => 'bigint',
42 inflate_datetime => 1,
48 __PACKAGE__->set_primary_key( 'id' );