db-migrate-mysql
Advanced tools
Comparing version 1.1.3 to 1.1.4
34
index.js
@@ -12,3 +12,3 @@ var util = require('util'); | ||
var MysqlDriver = Base.extend({ | ||
init: function(connection, internals) { | ||
init: function(connection) { | ||
this._escapeDDL = '`'; | ||
@@ -18,3 +18,2 @@ this._escapeString = '\''; | ||
this.connection = connection; | ||
this.internals = internals; | ||
}, | ||
@@ -26,3 +25,3 @@ | ||
if(!this.internals.notransactions) { | ||
if(!internals.notransactions) { | ||
@@ -41,3 +40,3 @@ return this.runSql('SET AUTOCOMMIT=0;') | ||
if(!this.internals.notransactions) { | ||
if(!internals.notransactions) { | ||
@@ -310,3 +309,3 @@ return this.runSql('COMMIT;').nodeify(cb); | ||
var formattedDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss'); | ||
this.runSql('INSERT INTO `' + this.internals.migrationTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
this.runSql('INSERT INTO `' + internals.migrationTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
}, | ||
@@ -316,3 +315,3 @@ | ||
var formattedDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss'); | ||
this.runSql('INSERT INTO `' + this.internals.seedTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
this.runSql('INSERT INTO `' + internals.seedTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
}, | ||
@@ -362,3 +361,3 @@ | ||
log.sql.apply(null, arguments); | ||
if(this.internals.dryRun) { | ||
if(internals.dryRun) { | ||
return Promise.resolve().nodeify(callback); | ||
@@ -409,2 +408,7 @@ } | ||
function dummy() { | ||
arguments[arguments.length - 1]('not implemented'); | ||
} | ||
exports.connect = function(config, intern, callback) { | ||
@@ -414,5 +418,7 @@ var db; | ||
internals = intern; | ||
log = intern.mod.log; | ||
type = intern.mod.type; | ||
log = internals.mod.log; | ||
type = internals.mod.type; | ||
internals.interfaces.SeederInterface._makeParamArgs = dummy; | ||
if (typeof(mysql.createConnection) === 'undefined') { | ||
@@ -423,3 +429,11 @@ db = config.db || new mysql.createClient(config); | ||
} | ||
callback(null, new MysqlDriver(db, internals)); | ||
db.connect(function( err ) { | ||
if( err ) { | ||
return callback( err ); | ||
} | ||
callback(null, new MysqlDriver(db)); | ||
} ); | ||
}; |
{ | ||
"name": "db-migrate-mysql", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "db-migrate mysql driver", | ||
@@ -29,4 +29,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird": "^2.9.34", | ||
"db-migrate-base": "^1.2.1", | ||
"bluebird": "^3.1.1", | ||
"db-migrate-base": "^1.2.4", | ||
"moment": "^2.9.0", | ||
@@ -33,0 +33,0 @@ "mysql": "^2.5.4" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14390
339
- Removedbluebird@2.11.0(transitive)
Updatedbluebird@^3.1.1
Updateddb-migrate-base@^1.2.4