From: Rogan Hamby Date: Thu, 25 Jun 2020 20:04:04 +0000 (-0400) Subject: missed a few lines to cleanup and move ALTER statements to sql_noresult X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=2153322b0460499eecfe11da01b408ee74529f59 missed a few lines to cleanup and move ALTER statements to sql_noresult --- diff --git a/kmig.d/bin/mig-import b/kmig.d/bin/mig-import index c76a791..95ddfa6 100755 --- a/kmig.d/bin/mig-import +++ b/kmig.d/bin/mig-import @@ -309,31 +309,18 @@ sub restore_budgets { my $dom = $parser->parse_file($restore_file); sql_noresult($dbh,"DELETE FROM aqbudgets WHERE 1 = 1"); - my $sth = $dbh->prepare($query); - $sth->execute(); - sql_noresult($dbh,"DELETE FROM aqbudgetperiods WHERE 1 = 1"); - $sth = $dbh->prepare($query); - $sth->execute(); my $budget_ai; my $budgetperiod_ai; - foreach my $node ($dom->findnodes('/document/budgets')) { $budget_ai = sql_num($node->findvalue('./autoincrement')); } - foreach my $node ($dom->findnodes('/document/budgetperiods')) { $budgetperiod_ai = sql_num($node->findvalue('./autoincrement')); } - - $query = "ALTER TABLE aqbudgets AUTO_INCREMENT = $budget_ai"; - $sth = $dbh->prepare($query); - $sth->execute(); - - $query = "ALTER TABLE aqbudgetperiods AUTO_INCREMENT = $budgetperiod_ai"; - $sth = $dbh->prepare($query); - $sth->execute(); + sql_noresult($dbh,"ALTER TABLE aqbudgets AUTO_INCREMENT = $budget_ai"); + sql_noresult($dbh,"ALTER TABLE aqbudgetperiods AUTO_INCREMENT = $budgetperiod_ai"); foreach my $node ($dom->findnodes('/document/budgetperiods/value')) { my $budget_period_id = sql_num($node->findvalue('./budget_period_id'));