node-migrant
Data agnostic migrations
Installation
npm install migrant
Usage
var Migrant = MetaFile = ; moduleexports = dir: __dirname + '/migrations' // directory with migration files meta: path: __dirname + '/migrant.json' // meta information storage; moduleexports;
You can specify your custom store of meta data, e.g.:
var Migrant = meta = {}; // Meta Storage has very basic interface:var storage = { } { meta = value; }; moduleexports = dir: __dirname + '/migrations' meta: storage // custom storage; moduleexports;
npm
Using with You can put a special task in package.json file:
{
"name": "my-project",
"scripts": {
"migrate": "node migrant.js"
}
}
and then you be able to do npm run migrate
. Another option is to add shebang to the migrant executable and run it in a manual way.
Cli interface
Usage: migrant.js [options]
Options:
-h, --help output usage information
--up Migrate up
--down Migrate down
--create Create empty migration file
--count Migrate particular number of migration
--revert Revert last migration