Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

muv

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

muv

Migration toolkit for node.js with baselining and versioning integrity checks

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

MUV

Migration toolkit for node.js with baselining and versioning integrity checks.

Features

  • Migrations depend on data schema versions
  • Migrations running in transactions
  • Baselining existing databases to skip duplicate migrations

Installation

npm install --save muv

You should also install knex as it's a peer dependency of this package.

Usage

First, init project with knex init, add migrations with muv create, and then:

Usage
  $ muv <command> [options]

Commands
  status         Shows current schema-, baseline version, and pending migrations
  log            Lists executed migrations since baseline (pass -v to show all)
  baseline       Move baseline to a specified migration
  up             Performs all pending migrations
  down           Rollbacks last migration
  make           Makes a migration with a given name in migrations directory

Options for "up" and "down":
  up --to, -t <name>      Migrate upto specific version
  down --to, -t <name|0>  Migrate downto specific version or to baseline if 0
  (up|down) --dry-run, d  Only show list of potential changes without exeuting

Options for "baseline:
  baseline                  Query current schema version and baseline
  baseline --to, -t <name>  Move baseline to a specified version

Options for "make:
  make <name>  Make a timestamped migration file with a given name

Global options:
  --cwd          Specify the working directory
  --knexfile     Specify the knexfile path ($cwd/knexfile.js)
  --migrations   Specify migrations path ($cwd/migrations)
  --env          Specify environment ($KNEX_ENV || $NODE_ENV || 'development')
  --verbose, -v  Be more verbose

Examples
  $ muv status                # query current status
  $ muv up                    # migrate everyting
  $ muv up --to 20160905      # migrate to a given version
  $ muv down --to 0           # rollback all migrations (downto baseline)
  $ muv down                  # rollback single migration
  $ muv baseline              # shows current version and baseline
  $ muv baseline --to 201701  # sets baseline to a new version

Thank you

  • @sheerun for inspiration and starting point (knex-migrate)

License

MIT

Keywords

FAQs

Package last updated on 11 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc