X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fcreate-history-tables;h=c610e70cf1a2481aeb9e056eda94eaa95c4eda22;hb=c40e3c171c9ca3cda8f35df2975c476b9102bac9;hp=8d419d2877b0aef1c08d60dd18c1554d271df73b;hpb=eef1e8261ea49fe7c531598cbfca064ad3447a5e;p=freeside.git diff --git a/bin/create-history-tables b/bin/create-history-tables index 8d419d287..c610e70cf 100755 --- a/bin/create-history-tables +++ b/bin/create-history-tables @@ -2,7 +2,7 @@ use strict; use DBI; -use DBIx::DBSchema 0.21; +use DBIx::DBSchema 0.20; use DBIx::DBSchema::Table; use DBIx::DBSchema::Column; use DBIx::DBSchema::ColGroup::Unique; @@ -18,7 +18,7 @@ my $schema = dbdef(); #false laziness w/fs-setup my @tables = scalar(@ARGV) ? @ARGV - : grep { ! /^h_/ } $schema->tables; + : grep { ! /^(h|pg)_/ } $schema->tables; foreach my $table ( @tables ) { next if grep { /^h_$table/ } $schema->tables; warn "creating history table for $table\n"; @@ -65,16 +65,7 @@ foreach my $table ( @tables ) { 'default' => '', 'local' => '', } ), - map { - my $column = $tableobj->column($_); - $column->type('int') - if $column->type eq 'serial'; - $column->default('') - if $column->default =~ /^nextval\(/i; - ( my $local = $column->local ) =~ s/AUTO_INCREMENT//i; - $column->local($local); - $column; - } $tableobj->columns + map { $tableobj->column($_) } $tableobj->columns ], } ); foreach my $statement ( $h_tableobj->sql_create_table($dbh) ) {