@vttforge/core / MigrationRunner
Interface: MigrationRunner
Properties
targetVersion
readonlytargetVersion:string
The target version (last migration's version, or '0.0.0' if the list is empty).
Methods
register()
register():
void
Register the schemaVersion setting. Call once from your init hook so Foundry knows about it before any world load. Re-calls are idempotent (the underlying game.settings.register enforces that).
Returns
void
run()
run():
Promise<readonlystring[]>
Run every migration whose version is newer than the stored schemaVersion, in order. Returns the list of versions actually executed (empty when the world is already up to date). Throws VttfError VTTF-0004 wrapping the original error if any migration throws; throws VttfError VTTF-0005 if the stored version is older than compatibleVersion.
Call from your ready hook, gated by game.user.isGM; this method does NOT enforce GM-only itself so consumers can compose differently if needed.
Returns
Promise<readonly string[]>