Class ScriptSchemaMigration
java.lang.Object
com.soulfiremc.server.script.ScriptSchemaMigration
Handles migration of script node/edge JSON between schema versions.
When the node/edge format changes, add a new migration step here
and increment CURRENT_VERSION.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of a schema migration. -
Field Summary
Fields -
Method Summary
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONThe current schema version. Increment when making breaking changes to the node/edge JSON format.- See Also:
-
-
Method Details
-
migrate
public static ScriptSchemaMigration.MigrationResult migrate(int fromVersion, List<Map<String, com.google.gson.JsonElement>> nodes, List<Map<String, com.google.gson.JsonElement>> edges) Migrates nodes and edges from an older schema version to the current one. Returns the migrated data. If already at current version, returns unchanged.- Parameters:
fromVersion- the schema version of the datanodes- the raw node dataedges- the raw edge data- Returns:
- migrated node and edge data
-