Skip to content

ianstormtaylor/node-immigration

 
 

Repository files navigation

Immigration

NPM version NPM downloads Build status Test coverage

Simple, no-frills migration utility.

Installation

npm install -g immigration

Usage

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

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.

CLI

immigration up -a
immigration down -c 1

Attribution

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).

License

Apache 2.0

About

Simple, no-frills migration utility

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 81.0%
  • JavaScript 19.0%