From 2153322b0460499eecfe11da01b408ee74529f59 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Thu, 25 Jun 2020 16:04:04 -0400 Subject: [PATCH] missed a few lines to cleanup and move ALTER statements to sql_noresult --- kmig.d/bin/mig-import | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) 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')); -- 1.7.2.5