Skip to main content

Function: runMigrations()

function runMigrations(
adapter,
migrations,
opts?
): Promise<MigrationRunReport>;

Defined in: migrate.ts:144

Runs every migration newer than the store's recorded version, in ascending order, recording each one as it lands so a crash resumes instead of restarting.

Throws RASD_STORAGE_MIGRATION on a downgrade, a malformed list, or a step that fails — with the failing step's id in details, and with the ledger left at the last successfully applied version.

Parameters

ParameterType
adapterStorageAdapter
migrationsreadonly Migration[]
optsRunMigrationsOptions

Returns

Promise<MigrationRunReport>