Simple, no-frills migration utility.
npm install -g immigration
Only three commands and various config options. Created to run migration scripts without any boilerplate.
immigration [command] [options]
Options:
-d, --directory [dir] The path to migration scripts
-b, --begin [name] First script to begin on
-c, --count [num] The number of migrations to execute (default: all)
-e, --extension [ext] Supported file extensions (default: ".js")
-a, --all Explicitly execute all migrations (execute without count or begin)
Commands:
up [name] Migrate up
down [name] Migrate down
create [title] Create a new migration file
list List available migrations
Migrations can export two functions: up
and down
. These functions can accept a callback or return a promise for asynchronous actions, such as altering a database.
immigration up -a
immigration down -c 1
Loosely based on Rails and node-migrate, but purposely missing complexity that didn't work for my own deployments (E.g. writing to file for state).
Apache 2.0