0.2.0 • Published 3 years ago

ts-node-migrate v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ts-node-migrate

A generic typescript database migration cli for potentially multiple databases supported

npm type definitions GitHub last commit

Support databases:

  • Mongodb
  • Mysql (TBD)

Installation

npm i -g ts-node
npm i ts-node-migrate

Usage:

Before using the cli, setup environment variables below

TSNM_URL=mongodb://localhost:27017/test
TSNM_DB_TYPE=mongodb
TSNM_DIR=migrations
TSNM_TABLE_NAME=changelog

You can setup package.json scripts or run cli directly if installed globally

tsnm [options] [command]

Options:
  -h, --help      display help for command

Commands:
  new             Creates new migration template
  status          Verify migration status (default)
  up              Doing migration forward
  down            Doing migration backward
  help [command]  display help for command