MigrationScript

TypeExperimental

Signature

type MigrationScript<TMode> = (context) => ModeResult<TMode, void>;

packages-internal/typed-sql/src/migrator.ts:25

A free-form migration script: the up and down of a non-transactional migration, and the migrator's before and after scripts. It runs outside a transaction and brings its own database access. Call assertLockHeld between steps of long work; it throws once the migration lease is lost, so the script stops before another process starts migrating.

Type Parameters

  • TMode
    extends Mode
    default"async"

Parameters

  • context
    object
  • context.assertLockHeld
    () => void

Returns

ModeResult<TMode, void>

Used in guides

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open