now() is not protable, timestamp in perl space
Yuval Kogman [Wed, 30 Jul 2008 03:49:12 +0000 (03:49 +0000)]
lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm

index 2f59b41..5b2ac7d 100644 (file)
@@ -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;