umzug-beobachten

1.0.0 • Public • Published

umzug-beobachten

Build Status Coverage Status semantic-release Commitizen friendly

Watch your umzug migration directory and undo/redo when files change. This is intended for development mode only.

Installation

npm install --save-dev umzug-beobachten

Usage

const Umzug = require('umzug')
const watchMigrations = require('umzug-beobachten')

const umzug = new Umzug({
  ...
})

if (process.env.NODE_ENV !== 'production') {
  const watcher = watchMigrations(umzug)

  // that's it!  Now if you create a migration file the watcher will
  // automatically run it, and if you change a migration file, the
  // watcher will undo back to before that migration, run the new version,
  // and then rerun all the migrations after it.

  ...
  // if you need to stop the watcher later without killing the process:
  watcher.close()
}

Package Sidebar

Install

npm i umzug-beobachten

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jedwards1211