Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DatabaseMigrator

Migrator implementation that tracks applied migrations in a database table.

todo

allow configuring more of this

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly bus

Protected Readonly db

Protected initialized

initialized: boolean = false

True if we've initialized the migrator.

Protected Readonly injector

injector: Container

Protected Readonly migrations

migrations: Migrations

Methods

Protected applied

  • applied(migration: Migration): Promise<void>

apply

Protected applying

  • applying(migration: Migration): Promise<void>

Protected builder

Protected filterAppliedMigrations

  • filterAppliedMigrations(identifiers: string[]): Promise<string[]>

Protected filterPendingMigrations

  • filterPendingMigrations(identifiers: string[]): Promise<string[]>

Protected getAllMigrationIdentifiers

  • getAllMigrationIdentifiers(): string[]

getLastApplyGroup

  • getLastApplyGroup(): Promise<string[]>

Protected getNextGroupIdentifier

  • getNextGroupIdentifier(): Promise<number>

has

  • has(migration: Migration): Promise<boolean>

initialize

  • initialize(): Promise<void>

markApplied

migrate

  • migrate(identifiers?: string[]): Promise<void>
  • 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

  • rollback(identifiers?: string[]): 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>

Protected rolledBack

  • rolledBack(migration: Migration): Promise<void>

Protected rollingBack

  • rollingBack(migration: Migration): Promise<void>

undo

unmarkApplied

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.