X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fcreate-history-tables;h=d37d682d84d7de13c9e7a3a05a5629d322ff28a5;hb=88ad98c9bc5150a130c6df53132760152aa6a437;hp=fb4c866c6ed5e2b4e9caa638110bfbc43675f630;hpb=239484572a9191100993bb1e85ffe8834689feb0;p=freeside.git diff --git a/bin/create-history-tables b/bin/create-history-tables index fb4c866c6..d37d682d8 100755 --- a/bin/create-history-tables +++ b/bin/create-history-tables @@ -16,8 +16,13 @@ my $dbh = adminsuidsetup $user; my $schema = dbdef(); #false laziness w/fs-setup -foreach my $table ( grep { ! /^h_/ } $schema->tables ) { - my $tableobj = $schema->table($table); +my @tables = scalar(@ARGV) + ? @ARGV + : grep { ! /^h_/ } $schema->tables; +foreach my $table ( @tables ) { + warn "creating history table for $table\n"; + my $tableobj = $schema->table($table) + or die "unknown table $table (did you run dbdef-create?)\n"; my $h_tableobj = DBIx::DBSchema::Table->new( { name => "h_$table", primary_key => 'historynum', @@ -73,6 +78,6 @@ $dbh->commit or die $dbh->errstr; $dbh->disconnect or die $dbh->errstr; sub usage { - die "Usage:\n create-history-tables user\n"; + die "Usage:\n create-history-tables user [ table table ... ] \n"; }