From: Yuval Kogman Date: Wed, 30 Jul 2008 03:49:12 +0000 (+0000) Subject: now() is not protable, timestamp in perl space X-Git-Tag: v0.900201~87 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf628f4c72f5e26f4bcf74974c614ea30ea3b411;p=dbsrgits%2FDBIx-Class-Journal.git now() is not protable, timestamp in perl space --- diff --git a/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm b/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm index 2f59b41..5b2ac7d 100644 --- a/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm +++ b/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm @@ -6,7 +6,7 @@ __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); __PACKAGE__->table('changeset'); __PACKAGE__->add_columns( - ID => { + id => { data_type => 'integer', is_auto_increment => 1, is_primary_key => 1, @@ -20,7 +20,6 @@ __PACKAGE__->add_columns( set_date => { data_type => 'timestamp', is_nullable => 0, - default_value => 'now()', }, session_id => { data_type => 'varchar', @@ -29,6 +28,12 @@ __PACKAGE__->add_columns( }, ); -__PACKAGE__->set_primary_key('ID'); +sub new { + my $self = shift->next::method(@_); + $self->set_date(gmtime); # DateTime->now); + return $self; +} + +__PACKAGE__->set_primary_key('id'); 1;