Skip to content

Commit

Permalink
fix: run migration only once
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-shuliu committed Dec 17, 2024
1 parent 2ae9b3a commit 17cbf85
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions src/cls/IPM/Utils/Migration.cls
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,12 @@ 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
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())
}
Try {
Do ..MigrateZPMToIPM(verbose)
Do ..MigrateReposFromIPM09(verbose)
} Catch e {
Set sc = e.AsStatus()
}
Quit sc
}
Expand Down

0 comments on commit 17cbf85

Please sign in to comment.