umzug-massive-storage
v1.0.1
Published
use Postgres via `massive` as a storage location for `umzug`
Downloads
6
Readme
umzug-massive-storage
This is a plugin for Umzug so you can drop in an instance of Massive for the migration metadata storage location.
If you are using Postgres, and want to use Massive, but also need database migrations/source
control, then umzug
+ umzug-massive-storage
is a solution for you.
Documentation
Minimal Example
import * as Umzug from 'umzug'
import * as Massive from 'massive'
import { MassiveStorage } from 'umzug-massive-storage'
const massive = await Massive({ ...massiveOptions })
const umzugMassiveStorage = new MassiveStorage({
db: massive,
})
const umzug = new Umzug({
storage: umzugMassiveStorage,
...moreUmzugOptions,
})
// await umzug.up()
Usage
Installation
umzug-massive-storage
is available on npm.
npm i umzug-massive-storage
MassiveStorage Constructor Options
import { MassiveStorage } from 'umzug-massive-storage'
const massiveStorage = new MassiveStorage({
// The instance of Massive
// required
db: massiveInstance,
// The Postgres schema to store the migration table
// optional, default is 'meta'
schema: 'meta',
// The Postgres table to record the migration
// optional, default is 'migrations'
table: 'migrations',
})
License
See the LICENSE file.