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

Commit 34f4f8c8 by Mick Hansen

Merge pull request #2678 from mbroadst/supports-upserts

add dialect checks for upsert support
2 parents 313b78b8 63f11616
......@@ -34,6 +34,7 @@ AbstractDialect.prototype.supports = {
schemas: false,
transactions: true,
migrations: true,
upserts: true,
constraints: {
restrict: true
},
......
......@@ -12,7 +12,8 @@ var chai = require('chai')
, dialect = Support.getTestDialect()
, datetime = require('chai-datetime')
, _ = require('lodash')
, assert = require('assert');
, assert = require('assert')
, current = Support.sequelize;
chai.use(datetime);
chai.config.includeStack = true;
......@@ -40,6 +41,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
this.clock.restore();
});
if (current.dialect.supports.upserts) {
describe('upsert', function () {
it('works with upsert on id', function () {
return this.User.upsert({ id: 42, username: 'john' }).bind(this).then(function (created) {
......@@ -91,4 +93,6 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
});
});
});
}
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!