1.2.2
PgMigrate
(Object)
object
Name | Description |
---|---|
options.database string
|
database to apply migrations |
options.host string
(default 'localhost' )
|
database host |
options.port int
(default 5432 )
|
database port |
options.user string
|
database user |
options.password string
|
database password |
options.ssl boolean
|
can also be ISSLConfig-like option https://github.com/vitaly-t/pg-promise/wiki/Connection-Syntax#configuration-object |
options.migrationsSchema string
(default 'public' )
|
database migrations table schema |
options.migrationsTable string
(default 'migrations' )
|
database migrations table name |
options.migrationsDir string
(default './migrations' )
|
path to migrations dir |
options.verbose boolean
(default false )
|
attach pg-monitor |
Promise
:
const PgMigrate = require('@urbica/pg-migrate');
const pgMigrate = new PgMigrate({ database: 'test', migrationsDir: './migrations' });
pgMigrate
.connect()
.then(() => pgMigrate.migrate())
.then(() => pgMigrate.end());