umzug-massive-storage

use Postgres via `massive` as a storage location for `umzug`

Usage no npm install needed!

<script type="module">
  import umzugMassiveStorage from 'https://cdn.skypack.dev/umzug-massive-storage';
</script>

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.