-
Notifications
You must be signed in to change notification settings - Fork 27
Versioning Graphs
It might happen at some point that the structure of graphs needs to be changed, like if an activity need to change its name or that a connection could be defined in another way, as from on object to two objects. Versioning the graph is here so that when this is done, previous graphs do not crash.
The current graph version number is exported in /frog/imports/ui/GraphEditor/versionUpgrades.js
as GraphCurrentVersion
. When the graph structure is modified, this number needs to be incremented.
This object called GraphObjUpgrades
is located in /frog/imports/ui/GraphEditor/versionUpgrades.js
. Its attributes have a stringified version number x
as keys and consist of functions that take as input an object Graph of the format of graph version x-1
and output an equivalent object with its global structure consistent with the graphVersion x
.
This object called GraphIdUpgrades
is located in /frog/imports/ui/GraphEditor/versionUpgrades.js
. Its keys are also stringified version number x
that take as input an object containing only the graphId of the graph concerned and go through all mongoDB collections needed to update the entries as needed from graphVersion x-1
to x
.