0.1.3 • Published 3 months ago

@blackglory/pg-migrations v0.1.3

Weekly downloads
30
License
MIT
Repository
github
Last release
3 months ago

pg-migrations

A utility for database migrations with pg.

The module using customized options migrations.schema_version to record the schema version.

Install

npm install --save @blackglory/pg-migrations
# or
yarn add @blackglory/pg-migrations

API

interface IMigration {
  version: number
  up: string | ((client: Client) => PromiseLike<void>)
  down: string | ((client: Client) => PromiseLike<void>)
}

migrate

function migrate(client: Client, migrations: IMigration[], targetVersion?: number): Promise<void>

If targetVersion is undefined, then use the maximum version of migrations.

0.1.3

3 months ago

0.1.2

6 months ago

0.1.1

7 months ago

0.1.0

7 months ago