Options
All
  • Public
  • Public/Protected
  • All
Menu

sequential-migrate

Index

Library Exports

down

down: (to?: string) => Promise<void>

Type declaration

    • (to?: string): Promise<void>
    • Rolls back run migrations down to (but not including) the named migration. If no migration is provided, rolls back all migrations.

      The down script halts and exits if it encounters a migration with status missing or skipped, running all migrations it has already encountered.

      Parameters

      • Optional to: string

        the name of the migration to migrate down to

      Returns Promise<void>

getStatus

getStatus: () => Promise<{ containsMissing: boolean; containsSkipped: boolean; state: InferredState }>

Type declaration

    • (): Promise<{ containsMissing: boolean; containsSkipped: boolean; state: InferredState }>
    • Compares the migrations folder with the value returned by StateScript.get to return the InferredState. For convenience, booleans indicating whether there are missing and skipped migrations are also returned.

      Returns Promise<{ containsMissing: boolean; containsSkipped: boolean; state: InferredState }>

up

up: (to?: string) => Promise<void>

Type declaration

    • (to?: string): Promise<void>
    • Runs pending migrations from the most recent run migration up to (and including) the migration supplied, or to the most recent migration if none is supplied.

      up halts and exits if it encounters a migration with status missing or skipped, running all migrations it has already encountered.

      up runs MigrationScript.up before StateScript.add. This means that your first migration can be the one that creates the migration table or collection in your database. Just make sure that your StateScript can handle a table that doesn't exist.

      Parameters

      • Optional to: string

        the name of the migration to migrate up to

      Returns Promise<void>

miscellaneous

ConfigurationFile

ConfigurationFile: Partial<RuntimeConfiguration>

Any of the properties from RuntimeConfiguration

InferredState

InferredState: InferredStateItem[]

The application's view of the state of your migrations

RecordedState

RecordedState: RecordedStateItem[]

Generated using TypeDoc