New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postgres-migrate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgres-migrate

Execute migrations on a postgres database.

latest
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 08 Mar 2016

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