Socket
Socket
Sign inDemoInstall

db-migrate-pg

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-migrate-pg - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

11

CHANGELOG.md

@@ -0,1 +1,12 @@

<a name="0.4.0"></a>
# [0.4.0](https://github.com/db-migrate/pg/compare/v0.3.1...v0.4.0) (2018-04-02)
### Bug Fixes
* **version:** fallback to string based check ([8b6b958](https://github.com/db-migrate/pg/commit/8b6b958)), closes [#32](https://github.com/db-migrate/pg/issues/32)
* **version:** use server_version_num instead of server_version ([ba07af7](https://github.com/db-migrate/pg/commit/ba07af7))
<a name="0.3.1"></a>

@@ -2,0 +13,0 @@ ## [0.3.1](https://github.com/db-migrate/pg/compare/v0.3.0...v0.3.1) (2018-02-11)

41

index.js

@@ -163,3 +163,3 @@ var util = require('util');

return this.all('show server_version')
return this.all('show server_version_num')
.then(

@@ -169,10 +169,10 @@ function (result) {

result &&
result &&
result.length > 0 &&
result[0].server_version
result[0].server_version_num
) {
var version = result[0].server_version;
if (version.split('.').length !== 3) {
version += '.0';
}
var version = result[0].server_version_num;
var major = Math.floor(version / 10000);
var minor = Math.floor((version - major * 10000) / 100);
var patch = Math.floor(version - major * 10000 - minor * 100);
version = major + '.' + minor + '.' + patch
options.ifNotExists = semver.gte(version, '9.1.0');

@@ -186,2 +186,29 @@ }

)
.catch(
// not all DBs support server_version_num, fall back to server_version
function () {
return this.all('show server_version')
.then(
function (result) {
if (
result &&
result.length > 0 &&
result[0].server_version
) {
var version = result[0].server_version;
// handle versions like “10.2 (Ubuntu 10.2)”
version = version.split(' ')[0];
// handle missing patch numbers
if (version.split('.').length !== 3) {
version += '.0';
}
options.ifNotExists = semver.gte(version, '9.1.0');
// Get the current search path so we can change the current
// schema if necessary
return this.all('SHOW search_path');
}
}.bind(this)
)
}.bind(this)
)
.then(

@@ -188,0 +215,0 @@ function (result) {

2

package.json
{
"name": "db-migrate-pg",
"version": "0.3.1",
"version": "0.4.0",
"description": "A postgresql driver for db-migrate",

@@ -5,0 +5,0 @@ "main": "index.js",

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