Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-pg-migrate

Package Overview
Dependencies
Maintainers
3
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pg-migrate - npm Package Compare versions

Comparing version 4.5.0 to 4.5.1

7

CHANGELOG.md
# Change Log
## [4.5.1](2020-04-03)
### Fixed
- Do provide default cli option value only if not specified [#588](https://github.com/salsita/node-pg-migrate/pull/588)
- Fix locking [#586](https://github.com/salsita/node-pg-migrate/pull/586)
## [4.5.0](2020-04-01)

@@ -4,0 +11,0 @@

13

dist/runner.js

@@ -34,7 +34,13 @@ "use strict";

const lock = async (db) => {
const [lockObtained] = await db.select(`select pg_try_advisory_lock(${PG_MIGRATE_LOCK_ID}) as "lockObtained"`);
if (!lockObtained) {
const [result] = await db.select(`select pg_try_advisory_lock(${PG_MIGRATE_LOCK_ID}) as "lockObtained"`);
if (!result.lockObtained) {
throw new Error('Another migration is already running');
}
};
const unlock = async (db) => {
const [result] = await db.select(`select pg_advisory_unlock(${PG_MIGRATE_LOCK_ID}) as "lockReleased"`);
if (!result.lockReleased) {
throw new Error('Failed to release migration lock');
}
};
const ensureMigrationsTable = async (db, options) => {

@@ -173,4 +179,7 @@ try {

finally {
if (!options.noLock) {
await unlock(db).catch((error) => logger.warn(error.message));
}
db.close();
}
};

2

package.json
{
"name": "node-pg-migrate",
"version": "4.5.0",
"version": "4.5.1",
"description": "Postgresql database migration management tool for node.js",

@@ -5,0 +5,0 @@ "author": "Theo Ephraim",

Sorry, the diff of this file is not supported yet

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