Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A command line interface for VersionDB
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE.md
README.md
index.js
package.json

README.md

Version DB

A command line utility for maintaining the schema version of a database.

How it works

Version DB includes a single table in that target database that tracks which version of each product's database schema resides in the database. Every time it is run, it checks what version of a product's database schema is on the database, checks the schema file, and runs all of the scripts required to bring the database schema up to the latest version.

If a product does not exist in the database, all of the scripts will be run on the database to create a schema that is the latest version.

Installation

npm install -g versiondb-cli

Usage

To check what schemas are currently installed on a database

versiondb pg://user@password:localhost/database

To run upgrade scripts

versiondb pg://user@password:localhost/database scripts.json

JSON format

{
    "productname": {
        "1.0.0": "createscript.sql",
        "1.0.1": "upgradescript-1.0.1.sql",
        "1.0.2": "fix-table.sql"
    },
    "otherproduct": {
        "2.0.0": "createother.sql"
    }
}

For more information on the versiondb file bundle format, see VersionDB File Bundle.

Something went wrong with that request. Please try again.