不要怂,就是干,撸起袖子干!

Commit 0ed07d90 by Jan Aagaard Meier

Merge pull request #4343 from Bibernull/master

use QueryTypes.UPDATE instead of RAW when incrementing a value of an …
2 parents 6eeff418 3a61c6e8
......@@ -681,7 +681,7 @@ QueryInterface.prototype.increment = function(instance, tableName, values, ident
options = options || {};
options.type = QueryTypes.RAW;
options.type = QueryTypes.UPDATE;
options.instance = instance;
return this.sequelize.query(sql, options);
};
......
......@@ -140,6 +140,16 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
}
if (current.dialect.supports.returnValues.returning) {
it('supports returning', function() {
return this.User.findById(1).then(function(user1) {
return user1.increment('aNumber', { by: 2 }).then(function() {
expect(user1.aNumber).to.be.equal(2);
});
});
});
}
it('supports where conditions', function() {
var self = this;
return this.User.findById(1).then(function(user1) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!