RT60983: why is *_audit_log id col an auto-inc?
Arthur Axel "fREW" Schmidt [Tue, 12 Oct 2010 00:30:50 +0000 (00:30 +0000)]
Changes
lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm

diff --git a/Changes b/Changes
index d9d2674..d8e3b3e 100644 (file)
--- 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
index 70fe818..358f0b0 100644 (file)
@@ -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 );