New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mygrate

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mygrate

Database migrations for MySQL and PostgreSQL database.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

mygrate

Database migrations for MySQL and PostgreSQL database.

This utility uses SQL files for migrations that, if need be, can be run by mysql or psql command line utilities. It does not try to be cute.

Installation

npm install -g mygrate

Depending on your database, you will need to install either

npm install mysql

npm install pg

Running

To create migrations directory and config.js sample which must be edited for your database.

mygrate init

To create a migration script.

mygrate new add-tables

That command creates migration/TIMESTAMP-add-tables/{down,up}.sql. Edit these scripts as needed.

To run migrations, do any of the following

mygrate up                           # migrate all scripts
mygrate down                         # down 1 migration
mygrate down 2                       # down 2 migrations
mygrate down all                     # down all migrations
mygrate down TIMESTAMP-some-script   # down to migration before this one

To view migrations applied to the database

mygrate

To target specific environments, development is default

NODE_ENV=test mygrate up

FAQs

Package last updated on 09 Jul 2012

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