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

db-migrate-mysql

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-migrate-mysql - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

Makefile

62

index.js

@@ -126,10 +126,2 @@ var util = require('util');

if (spec.engine && typeof spec.engine === 'string') {
constraint.push("ENGINE='" + spec.engine + "'");
}
if (spec.rowFormat && typeof spec.rowFormat === 'string') {
constraint.push("ROW_FORMAT='" + spec.rowFormat + "'");
}
if (spec.onUpdate && spec.onUpdate.startsWith('CURRENT_TIMESTAMP')) {

@@ -160,3 +152,3 @@ constraint.push('ON UPDATE ' + spec.onUpdate);

if (spec.comment) {
constraint.push(`COMMENT '${spec.comment}`);
constraint.push(`COMMENT '${spec.comment}'`);
}

@@ -176,2 +168,28 @@

_applyTableOptions: function (spec, tableName) {
const tableOpts = [];
// if there is no columns in the options object
// it means it was a default payload without table options
if (!spec.columns) return '';
if (spec.engine && typeof spec.engine === 'string') {
tableOpts.push(`ENGINE ${spec.engine}`);
}
if (spec.rowFormat && typeof spec.rowFormat === 'string') {
tableOpts.push(`ROW_FORMAT ${spec.rowFormat}`);
}
if (spec.collate && typeof spec.collate === 'string') {
tableOpts.push(`COLLATE '${spec.collate}'`);
}
if (spec.charset && typeof spec.charset === 'string') {
tableOpts.push(`CHARACTER SET ${spec.charset}`);
}
return tableOpts.join(' ');
},
createDatabase: function (dbName, options, callback) {

@@ -267,13 +285,18 @@ var spec = '';

// So, check the args to ensure they are valid
if (arguments.length === 2 && typeof indexName === 'function') {
if (
arguments.length === 1 ||
(arguments.length === 2 && typeof indexName === 'function')
) {
callback = indexName;
process.nextTick(function () {
callback(
new Error(
'Illegal arguments, must provide "tableName" and "indexName"'
)
);
});
const err = new Error(
'Illegal arguments, must provide "tableName" and "indexName"'
);
return;
if (typeof indexName === 'function') {
process.nextTick(function () {
callback(err);
});
}
return Promise.reject(err);
}

@@ -438,3 +461,4 @@

var sql = params.shift();
var callback = params.pop();
var callback =
typeof params[params.length - 1] === 'function' ? params.pop() : null;

@@ -441,0 +465,0 @@ if (params.length > 0 && Array.isArray(params[0])) {

{
"name": "db-migrate-mysql",
"version": "2.0.0",
"version": "2.1.0",
"description": "db-migrate mysql driver",
"main": "index.js",
"scripts": {
"test": "node node_modules/.bin/vows"
"test": "lab -t 60"
},

@@ -30,3 +30,3 @@ "repository": {

"bluebird": "^3.2.1",
"db-migrate-base": "^1.2.5",
"db-migrate-base": "^2.1.0",
"moment": "^2.11.2",

@@ -36,2 +36,4 @@ "mysql": "^2.17.1"

"devDependencies": {
"@hapi/code": "^7.0.0",
"@hapi/lab": "^21.0.0",
"db-meta": "^0.4.1",

@@ -44,6 +46,4 @@ "db-migrate-shared": "^1.1.2",

"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"lab": "^18.0.2",
"vows": "0.8.0"
"eslint-plugin-standard": "^4.0.1"
}
}
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