db-migrate-mysql
Advanced tools
Comparing version 1.1.1 to 1.1.2
21
index.js
@@ -12,3 +12,3 @@ var util = require('util'); | ||
var MysqlDriver = Base.extend({ | ||
init: function(connection) { | ||
init: function(connection, internals) { | ||
this._escapeDDL = '`'; | ||
@@ -18,2 +18,3 @@ this._escapeString = '\''; | ||
this.connection = connection; | ||
this.internals = internals; | ||
}, | ||
@@ -25,3 +26,3 @@ | ||
if(!internals.notransactions) { | ||
if(!this.internals.notransactions) { | ||
@@ -40,3 +41,3 @@ return this.runSql('SET AUTOCOMMIT=0;') | ||
if(!internals.notransactions) { | ||
if(!this.internals.notransactions) { | ||
@@ -309,3 +310,3 @@ return this.runSql('COMMIT;').nodeify(cb); | ||
var formattedDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss'); | ||
this.runSql('INSERT INTO `' + internals.migrationTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
this.runSql('INSERT INTO `' + this.internals.migrationTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
}, | ||
@@ -315,3 +316,3 @@ | ||
var formattedDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss'); | ||
this.runSql('INSERT INTO `' + internals.seedTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
this.runSql('INSERT INTO `' + this.internals.seedTable + '` (`name`, `run_on`) VALUES (?, ?)', [name, formattedDate], callback); | ||
}, | ||
@@ -361,3 +362,3 @@ | ||
log.sql.apply(null, arguments); | ||
if(internals.dryRun) { | ||
if(this.internals.dryRun) { | ||
return Promise.resolve().nodeify(callback); | ||
@@ -417,6 +418,6 @@ } | ||
internals = intern; | ||
log = internals.mod.log; | ||
type = internals.mod.type; | ||
log = intern.mod.log; | ||
type = intern.mod.type; | ||
internals.interfaces.SeederInterface._makeParamArgs = dummy; | ||
intern.interfaces.SeederInterface._makeParamArgs = dummy; | ||
@@ -428,3 +429,3 @@ if (typeof(mysql.createConnection) === 'undefined') { | ||
} | ||
callback(null, new MysqlDriver(db)); | ||
callback(null, new MysqlDriver(db, internals)); | ||
}; |
{ | ||
"name": "db-migrate-mysql", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "db-migrate mysql driver", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
14366
335