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

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.2.5 to 0.3.0

CHANGELOG.md

26

index.js

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

this.schema = schema || "public";
this.connection.connect();
},

@@ -166,11 +165,11 @@

return this.all('select version() as version')
return this.all('show server_version')
.then(function(result) {
if (result && result && result.length > 0 && result[0].version) {
var version = result[0].version;
var match = version.match(/\d+\.\d+\.\d+/);
if (match && match[0] && semver.gte(match[0], '9.1.0')) {
options.ifNotExists = true;
if (result && result && result.length > 0 && result[0].server_version) {
var version = result[0].server_version;
if(version.split('.').length !== 3){
version += '.0';
}
options.ifNotExists = semver.gte(version, '9.1.0');
}

@@ -405,4 +404,5 @@

var using = columnSpec.using !== undefined ?
columnSpec.using : util.format('USING "%s"::%s', columnName, this.mapDataType(columnSpec.type))
var sql = util.format('ALTER TABLE "%s" ALTER COLUMN "%s" TYPE %s %s', tableName, columnName, this.mapDataType(columnSpec.type), using);
columnSpec.using : util.format('USING "%s"::%s', columnName, this.mapDataType(columnSpec.type));
var len = columnSpec.length ? util.format('(%s)', columnSpec.length) : '';
var sql = util.format('ALTER TABLE "%s" ALTER COLUMN "%s" TYPE %s %s %s', tableName, columnName, this.mapDataType(columnSpec.type), len, using);
return this.runSql(sql);

@@ -522,6 +522,12 @@ }

if (config.native) { pg = pg.native; }
if(!config.database) { config.database = 'postgres'; }
var db = config.db || new pg.Client(config);
callback(null, new PgDriver(db, config.schema, intern));
db.connect(function(err) {
if(err) {
callback(err);
}
callback(null, new PgDriver(db, config.schema, intern));
});
};
exports.base = PgDriver;
{
"name": "db-migrate-pg",
"version": "0.2.5",
"version": "0.3.0",
"description": "A postgresql driver for db-migrate",

@@ -35,3 +35,3 @@ "main": "index.js",

"db-migrate-base": "^1.5.2",
"pg": "^4.5.7",
"pg": "^7.0.0",
"semver": "^5.0.3"

@@ -38,0 +38,0 @@ },

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