1.0.0 • Published 6 years ago
umzug-beobachten v1.0.0
umzug-beobachten
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()
}
1.0.0
6 years ago