Skip to content

Commit

Permalink
Revert "fix: run migration only once"
Browse files Browse the repository at this point in the history
This reverts commit 17cbf85.
  • Loading branch information
isc-shuliu committed Dec 17, 2024
1 parent 17cbf85 commit 9422971
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/cls/IPM/Utils/Migration.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9422971

Please sign in to comment.