From 712e998c34b3cfd0eef71f99acbf3c82647fd81a Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 3 Jun 2020 11:39:14 -0400 Subject: [PATCH] mig-import missed a clause for deleting from the itemtypes table --- kmig.d/bin/mig-import | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/kmig.d/bin/mig-import b/kmig.d/bin/mig-import index 4483c23..e94e5d0 100755 --- a/kmig.d/bin/mig-import +++ b/kmig.d/bin/mig-import @@ -446,7 +446,6 @@ sub restore_itemtypes { my $sth = $dbh->prepare($query); $sth->execute(); - $query = "DELETE FROM authorised_values WHERE category = 'ITEMTYPECAT'"; $sth = $dbh->prepare($query); $sth->execute(); @@ -455,6 +454,10 @@ sub restore_itemtypes { $sth = $dbh->prepare($query); $sth->execute(); + $query = "DELETE FROM itemtypes WHERE 1 = 1"; + $sth = $dbh->prepare($query); + $sth->execute(); + foreach my $node ($dom->findnodes('/document/authorised_values/value')) { my $category = sql_str($node->findvalue('./category')); my $authvalue = sql_str($node->findvalue('./authvalue')); -- 1.7.2.5