From 94229716b93e821d8b784c01f5525f2d4f8c5bdc Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Tue, 17 Dec 2024 16:17:42 -0500 Subject: [PATCH] Revert "fix: run migration only once" This reverts commit 17cbf8572a8ee8f6ce665adba2c911abdcb89e9b. --- src/cls/IPM/Utils/Migration.cls | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/cls/IPM/Utils/Migration.cls b/src/cls/IPM/Utils/Migration.cls index d36384fc..65573067 100644 --- a/src/cls/IPM/Utils/Migration.cls +++ b/src/cls/IPM/Utils/Migration.cls @@ -5,12 +5,30 @@ Class %IPM.Utils.Migration ClassMethod RunAll(verbose As %Boolean = 1) As %Status { + Set tOriginalNS = $Namespace + Do ##class(%IPM.Main).GetListNamespace(.list) + New $Namespace + Set $Namespace = "%SYS" + Set sourceDB = ##class(%SYS.Namespace).GetPackageDest(tOriginalNS, "%IPM") + + Set ns = "" Set sc = $$$OK - Try { - Do ..MigrateZPMToIPM(verbose) - Do ..MigrateReposFromIPM09(verbose) - } Catch e { - Set sc = e.AsStatus() + For { + Set ns = $Order(list(ns)) + // Perform migration for namespaces to which %IPM is mapped from the current namespace's default routine database + If ##class(%SYS.Namespace).GetPackageDest(ns, "%IPM") '= sourceDB { + Continue + } + If ns = "" { + Quit + } + Try { + Set $Namespace = $Zstrip(ns,"<>WC") + Do ..MigrateZPMToIPM(verbose) + Do ..MigrateReposFromIPM09(verbose) + } Catch e { + Set sc = $$$ADDSC(sc, e.AsStatus()) + } } Quit sc }