From: Arthur Axel "fREW" Schmidt Date: Mon, 26 Apr 2010 20:32:44 +0000 (+0000) Subject: various fixes from RT56920 X-Git-Tag: v0.900201~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b34c693614955dc9969d1c1af2b0b0e506b5f3df;p=dbsrgits%2FDBIx-Class-Journal.git various fixes from RT56920 --- diff --git a/lib/DBIx/Class/Schema/Journal/DB.pm b/lib/DBIx/Class/Schema/Journal/DB.pm index 1cd7330..dbc3679 100644 --- a/lib/DBIx/Class/Schema/Journal/DB.pm +++ b/lib/DBIx/Class/Schema/Journal/DB.pm @@ -38,7 +38,7 @@ sub current_changeset { sub journal_create_changeset { my ( $self, @args ) = @_; - my %changesetdata = ( @args, ID => undef ); + my %changesetdata = ( @args ); delete $changesetdata{parent_id} unless $self->nested_changesets; diff --git a/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm b/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm index d631066..1a22eb8 100644 --- a/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm +++ b/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm @@ -4,33 +4,33 @@ use base 'DBIx::Class::Core'; sub journal_define_table { my ( $class, $schema_class, $prefix ) = @_; - + $class->load_components(qw/InflateColumn::DateTime/); $class->table($prefix . 'changeset'); - + $class->add_columns( - ID => { - data_type => 'integer', - is_auto_increment => 1, - is_primary_key => 1, - is_nullable => 0, - }, - user_id => { - data_type => 'integer', - is_nullable => 1, - is_foreign_key => 1, - }, - set_date => { - data_type => 'timestamp', - is_nullable => 0, - }, - session_id => { - data_type => 'varchar', - size => 255, - is_nullable => 1, - }, + ID => { + data_type => 'integer', + is_auto_increment => 1, + is_primary_key => 1, + is_nullable => 0, + }, + user_id => { + data_type => 'integer', + is_nullable => 1, + is_foreign_key => 1, + }, + set_date => { + data_type => 'timestamp', + is_nullable => 0, + }, + session_id => { + data_type => 'varchar', + size => 255, + is_nullable => 1, + }, ); - + $class->set_primary_key('ID'); } @@ -42,7 +42,7 @@ sub new { # import?) to do it and retain backcompat I will. # # --fREW, 01-27-2010 - $self->set_date(gmtime); + $self->set_date(scalar gmtime); return $self; }