From: Rogan Hamby Date: Wed, 3 Jun 2020 15:39:14 +0000 (-0400) Subject: mig-import missed a clause for deleting from the itemtypes table X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=712e998c34b3cfd0eef71f99acbf3c82647fd81a mig-import missed a clause for deleting from the itemtypes table --- 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'));