1.1.2 • Published 8 years ago

postgres-migrate v1.1.2

Weekly downloads
25
License
BSD-3-Clause
Repository
-
Last release
8 years ago

postgres-migrate

NPM version Build Status

Migrations for PostgreSQL databases utilizing advisory locks.

Usage

Keep your migration files in a separate folder, as individual .sql files.

var migrate = require('postgres-migrate');

migrate({
    conString: 'postgres://dbuser:dbpass@dbhost:32321/dbname',
    migrationsDir: 'path/to/migrationsDirectory',
    reporter: console.log.bind(console) // optional parameter
}).then(function () {
    // The database is ready to be used!
}).catch(function (err) {
    // Something bad happened!
});

You can safely start multiple workers at the same time. Only one of them will take the lock, and upgrade the database. The others will wait for the migration to be completed, and then resolve the promise.

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago