1 package # hide from PAUSE
9 use Time::Piece::MySQL;
12 __PACKAGE__->set_table();
13 __PACKAGE__->columns(All => qw/id message datetime_stamp/);
15 datetime_stamp => 'Time::Piece',
16 inflate => 'from_mysql_datetime',
17 deflate => 'mysql_datetime'
20 # Disables the implicit autoinc-on-non-supplied-pk behavior
21 # (and the warning that goes with it)
22 # This is the same behavior as it was pre 0.082900
23 __PACKAGE__->column_info('id')->{is_auto_increment} = 0;
25 __PACKAGE__->add_trigger(before_create => \&set_dts);
26 __PACKAGE__->add_trigger(before_update => \&set_dts);
29 shift->datetime_stamp(
30 POSIX::strftime('%Y-%m-%d %H:%M:%S', localtime(time)));
35 id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
37 datetime_stamp DATETIME