Socket
Socket
Sign inDemoInstall

db-migrate

Package Overview
Dependencies
Maintainers
2
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-migrate - npm Package Compare versions

Comparing version 1.0.0-beta.18 to 1.0.0-beta.19

38

lib/driver/index.js

@@ -95,15 +95,20 @@ var internals = {};

var connect = function (config) {
driver.connect(config, intern, function (err, db) {
if (err) {
callback(err);
return;
}
log.verbose('connected');
driver.connect(
// safe disconnect of our config object into userspace
JSON.parse(JSON.stringify(config)),
intern,
function (err, db) {
if (err) {
callback(err);
return;
}
log.verbose('connected');
if (!global.immunity) {
db = Shadow.infect(db, internals, ShadowProto);
if (!global.immunity) {
db = Shadow.infect(db, internals, ShadowProto);
}
callback(null, db);
}
callback(null, db);
});
);
};

@@ -128,7 +133,8 @@

if (plugin) {
tunnel = plugin[
`connection:tunnel:${
tunnelType && tunnelType !== 'ssh' ? tunnelType : 'ssh'
}`
](tunnelConfig);
tunnel =
plugin[
`connection:tunnel:${
tunnelType && tunnelType !== 'ssh' ? tunnelType : 'ssh'
}`
](tunnelConfig);
}

@@ -135,0 +141,0 @@

@@ -11,3 +11,3 @@ const Promise = require('bluebird');

if (!this.schema[t][c]) {
if (!this.schema[t][c] && !this.schema[t].columns[c]) {
throw new Error(`There is no ${c} column in schema!`);

@@ -125,4 +125,6 @@ }

this.checkColumn(t, c);
const hasColumns = this.schema[t].columns !== undefined
const columns = hasColumns ? this.schema[t].columns ? this.schema[t];
if (this.schema[t][c].notNull === true) {
if (columns[c].notNull === true) {
if (this.validations.columnStrategies !== true) {

@@ -175,6 +177,6 @@ if (

if (this.schema[t][c].notNull === true) {
if (columns[c].notNull === true) {
switch (o.columnStrategy) {
case 'delay':
this.modS[t][c] = this.schema[t][c];
this.modS[t][c] = columns[c];

@@ -194,3 +196,3 @@ o.passthrough = o.passthrough || {};

case 'defaultValue':
this.modS[t][c] = this.schema[t][c];
this.modS[t][c] = columns[c];
this.modS[t][c].defaultValue = o.passthrough.defaultValue;

@@ -202,3 +204,3 @@

} else {
this.modS[t][c] = this.schema[t][c];
this.modS[t][c] = columns[c];

@@ -208,3 +210,7 @@ this.modC.push({ t: 1, a: 'addColumn', c: [t, c, o] });

delete this.schema[t][c];
if(hasColumns) {
delete this.schema[t].columns[c];
} else {
delete this.schema[t][c];
}

@@ -230,4 +236,7 @@ return Promise.resolve(alter);

this.schema[t] = this.schema[t] || {};
this.schema[t][c] = s;
const hasColumns = this.schema[t].columns !== undefined
const columns = hasColumns ? this.schema[t].columns ? this.schema[t];
columns[c] = s;
this.modC.push({ t: 0, a: 'removeColumn', c: [t, c] });

@@ -243,5 +252,9 @@

this.modS[t][c] = this.schema[t][c];
this.schema[t][c] = Object.assign(this.schema[t][c], s);
const hasColumns = this.schema[t].columns !== undefined
const columns = hasColumns ? this.schema[t].columns ? this.schema[t];
this.modS[t][c] = columns[c];
columns[c] = Object.assign(columns[c], s);
this.modC.push({ t: 1, a: 'changeColumn', c: [t, c] });

@@ -248,0 +261,0 @@

@@ -55,3 +55,3 @@ const Promise = require('bluebird');

`This index did not exist at the time of deleting it. ` +
`This can happen if an index was created by hand and then deleted` +
`This can happen if an index was created by hand and then deleted ` +
`by db-migrate. Make sure to recreate it by hand to avoid any problems.`

@@ -58,0 +58,0 @@ );

@@ -34,3 +34,3 @@ {

],
"version": "1.0.0-beta.18",
"version": "1.0.0-beta.19",
"engines": {

@@ -57,6 +57,6 @@ "node": ">=8.0.0"

"rc": "^1.2.8",
"resolve": "^1.1.6",
"resolve": "^1.19.0",
"semver": "^5.3.0",
"tunnel-ssh": "^4.0.0",
"yargs": "^15.3.1"
"yargs": "^17.5.1"
},

@@ -63,0 +63,0 @@ "devDependencies": {

[![Backers on Open Collective](https://opencollective.com/node-db-migrate/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/node-db-migrate/sponsors/badge.svg)](#sponsors)
[![Build Status](https://travis-ci.org/db-migrate/node-db-migrate.svg?branch=master)](https://travis-ci.org/db-migrate/node-db-migrate)
[![Build Status](https://github.com/db-migrate/node-db-migrate/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/db-migrate/node-db-migrate/actions/workflows/ci.yml)
[![Dependency Status](https://david-dm.org/db-migrate/node-db-migrate.svg)](https://david-dm.org/db-migrate/node-db-migrate)

@@ -4,0 +4,0 @@ [![devDependency Status](https://david-dm.org/db-migrate/node-db-migrate/dev-status.svg)](https://david-dm.org/db-migrate/node-db-migrate#info=devDependencies)

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