X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FMySchema%2FFoo.pm;fp=t%2Flib%2FMySchema%2FFoo.pm;h=ca4f5baebf2238a7340c44ba0d717d2728464ad3;hb=8e52f1dac7a38f80608ab1af805e70aa9e9dafd1;hp=0000000000000000000000000000000000000000;hpb=574a1212ba7f55626cdd8d54918410ca1536ea31;p=dbsrgits%2FDBIx-Class-DateTime-Epoch.git diff --git a/t/lib/MySchema/Foo.pm b/t/lib/MySchema/Foo.pm new file mode 100644 index 0000000..ca4f5ba --- /dev/null +++ b/t/lib/MySchema/Foo.pm @@ -0,0 +1,46 @@ +package MySchema::Foo; + +use strict; +use warnings; + +use base qw( DBIx::Class ); + +__PACKAGE__->load_components( qw( DateTime::Epoch TimeStamp Core ) ); +__PACKAGE__->table( 'foo' ); +__PACKAGE__->add_columns( + id => { + data_type => 'bigint', + is_auto_increment => 1, + is_nullable => 0, + }, + name => { + data_type => 'varchar', + size => 10, + is_nullable => 1, + }, + bar => { # epoch stored as an int + data_type => 'bigint', + inflate_datetime => 1, + }, + baz => { # epoch stored as a string + data_type => 'varchar', + size => 50, + inflate_datetime => 'epoch', + }, + # working in conjunction with DBIx::Class::TimeStamp + creation_time => { + data_type => 'bigint', + inflate_datetime => 1, + set_on_create => 1, + }, + modification_time => { + data_type => 'bigint', + inflate_datetime => 1, + set_on_create => 1, + set_on_update => 1, + } +); + +__PACKAGE__->set_primary_key( 'id' ); + +1;