Merge pull request #128 from devuo/feature/fix-upsert-transaction

Fix database transactions not working with upsert()
This commit is contained in:
Raymond Feng 2015-10-11 12:56:18 -07:00
commit 46454f4bee
1 changed files with 1 additions and 2 deletions

View File

@ -234,7 +234,7 @@ MySQL.prototype.updateOrCreate = MySQL.prototype.save =
sql.merge(ParameterizedSQL.join(setValues, ',')); sql.merge(ParameterizedSQL.join(setValues, ','));
this.execute(sql.sql, sql.params, function(err, info) { this.execute(sql.sql, sql.params, options, function(err, info) {
if (!err && info && info.insertId) { if (!err && info && info.insertId) {
data.id = info.insertId; data.id = info.insertId;
} }
@ -483,4 +483,3 @@ MySQL.prototype.buildExpression = function(columnName, operator, operatorValue,
require('./migration')(MySQL, mysql); require('./migration')(MySQL, mysql);
require('./discovery')(MySQL, mysql); require('./discovery')(MySQL, mysql);
require('./transaction')(MySQL, mysql); require('./transaction')(MySQL, mysql);