0.0.15-a • Published 9 years ago

migratory v0.0.15-a

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

Migratory

Imports SQL files into specified DB within a transaction.

For those of you that prefer to use SQL rather than ORMs, or you just have some DB dumps kicking around that you'd rather safely import via a transaction.

Can be used to populate structure, data or both.

Compatible with database dumps.

Supported RDBMS

  • Postgresql
  • MySQL

SQLite coming soon...

Usage:

Installation:

Preferred method of installation is globally via npm:

npm install -g migratory

Any projects in which you'd like to use Migratory, first run:

migratory init

This will create a base settings file (migratory.json) that looks something like this:

{
    "Destination Label": {
        "host": "",
        "database": "",
        "type": "",
        "schema": "",
     }
}

Destination Label: A User-Friendly label that you'll recognize as a server. Maybe "Dev", "QA", or "Production"

host: Server on which to deploy

database: Database on which your SQL commands will be executed

type: The Type of DB to connect to. Currently only supporting pgsql

schema: Optional. Search path to be set.

Credentials will be input at the time of migrations for security reasons.

You can add as many servers as you like into this json object; local or remote.

Once you're done, you're ready to use Migratory!

Running Migrations

Once you're all set up with your migratory.json file, you can run your deployments. You'll need to run these deployments from the directory that contains your migratory.js file.

migratory sqlFile1 sqlFile2

You will then be prompted to choose the database you wish to import the specified files into.

Once chosen, Migratory will import sqlFile1 and sqlFile2 into specified DB sequentially within a transaction.

There's no limit to the amount of files you can import in one command. If any errors are encountered, all changes will be rolled back.

Login Credentials

These will be asked upon migration for security purposes

Foreseeable updates:

  • Importing of all migrations in directory
  • Different import actions (up/down -- this will require directory structure, additional files)
  • Grunt / Gulp integration
  • SSL

Pull requests welcome.

version 0.0.14a

0.0.15-a

9 years ago

0.0.14-a

9 years ago

0.0.13-a

9 years ago

0.0.12-a

9 years ago

0.0.11-a

9 years ago

0.0.10-a

9 years ago

0.0.9-a

9 years ago

0.0.8-a

9 years ago

0.0.7-a

9 years ago

0.0.6-a

9 years ago

0.0.5-a

9 years ago

0.0.4-a

9 years ago

0.0.3-a

9 years ago

0.0.2-a

9 years ago

0.0.1-a

9 years ago

0.0.1

9 years ago