From: Arthur Axel "fREW" Schmidt Date: Tue, 12 Oct 2010 00:30:50 +0000 (+0000) Subject: RT60983: why is *_audit_log id col an auto-inc? X-Git-Tag: v0.900201~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f90c0e336a93775b548647c33facefdae08911cc;p=dbsrgits%2FDBIx-Class-Journal.git RT60983: why is *_audit_log id col an auto-inc? --- diff --git a/Changes b/Changes index d9d2674..d8e3b3e 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ + - Don't copy column data from schema that does anything other + than define data type. e.g. autoinc stuff + 0.900200 2010-07-24 - No longer use 'scalar gmtime' for set_date in ChangeSet; that was brittle and doesn't work on many databases, now diff --git a/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm b/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm index 70fe818..358f0b0 100644 --- a/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm +++ b/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm @@ -25,7 +25,15 @@ sub journal_define_table { ); foreach my $column ( $source->primary_columns ) { - $class->add_column( $column => { %{ $source->column_info($column) } } ); + my %column_info = %{$source->column_info($column)}; + delete $column_info{$_} for qw( + is_autoincrement + is_foreign_key + default_value + sequence + auto_nextval + ); + $class->add_column( $column => \%column_info ); } $class->set_primary_key( $source->primary_columns );