Skip to main content

Type Alias: MigrationRunnerOptions

MigrationRunnerOptions = object

Defined in: migrations/runner.ts:23

Properties

allowUnbaselined?

optional allowUnbaselined?: boolean

Defined in: migrations/runner.ts:56

The default for run's option of the same name: run against a populated database whose ledger is empty, which the runner otherwise refuses. Set it where the application knows its database can only ever be new — a test fixture, or a deployment that creates one per run.

Default

false

ledgerTable?

optional ledgerTable?: string

Defined in: migrations/runner.ts:41

Default

'schema_migrations'

lockKey?

optional lockKey?: number

Defined in: migrations/runner.ts:37

Default

DEFAULT_MIGRATION_LOCK_KEY

lockTimeoutMs?

optional lockTimeoutMs?: number

Defined in: migrations/runner.ts:39

Bound on waiting for the lock; see syncWithAdvisoryLock.


log?

optional log?: (message) => void

Defined in: migrations/runner.ts:48

Where progress goes.

Parameters

ParameterType
messagestring

Returns

void

Default

stderr

migrations

migrations: Migration[]

Defined in: migrations/runner.ts:25

In the order they run. Names must be unique.


sequelize?

optional sequelize?: Sequelize

Defined in: migrations/runner.ts:35

The connection to run on. Omitted, the runner opens its own from the DATABASE_* environment variables and closes it on close().


sync?

optional sync?: () => Promise<void>

Defined in: migrations/runner.ts:30

The application's schema sync, made available to migrations as context.sync(). Optional: a migration that only rewrites data needs none.

Returns

Promise<void>


version?

optional version?: string

Defined in: migrations/runner.ts:46

Recorded with every applied migration — the application's version or image tag — so the ledger answers which release ran it.