Class DatabaseMigrator

Migrator implementation that tracks applied migrations in a database table.

Todo

allow configuring more of this

Hierarchy

Constructors

Properties

bus: Bus<Event>
initialized: boolean = false

True if we've initialized the migrator.

injector: Container
migrations: Migrations

Methods

  • Apply pending migrations.

    If identifiers are specified, only the pending migrations with those identifiers are applied. If none are specified, all pending migrations will be applied.

    Parameters

    • Optional identifiers: string[]

    Returns Promise<void>

  • Rollback applied migrations.

    If specified, only applied migrations with the given identifiers will be rolled back. If not specified, then the last "batch" of applied migrations will be rolled back.

    Parameters

    • Optional identifiers: string[]

    Returns Promise<void>