migrate
A flexible migration tool for node usable both from the cli and programmatically. It makes it easy to customize where to store state, and what template to use for migrations.
Installation
$ npm install migrate-js
Usage
Usage: migrate-js [options] [command]
Options:
-h, --help display this help menu
-d, --migrations-dir <path> set the directory where migrations are created (default: ./migrations)
-s, --state-manager <name> set state manager module to store state (default: json)
-t, --template <name> set template module to create new migrations with (default: simple)
Commands:
down rollback all migrations
up execute all migrations (the default command)
create [title] create a new migration file with optional [title]
Programmatic usage
See the examples folder for more, or check this live example.
const Migrate = ;const mysql = ; const db = mysql; const migrate = stateManager: "mysql" migrationsDirectory: process mysql: db; migrate;