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

Commit 2762b801 by Jan Aagaard Meier

Update dependencies

1 parent 66dc7694
......@@ -11,6 +11,11 @@ Notice: All 1.7.x changes are present in 2.0.x aswell
- [BUG] Fix problem with minConnections. [#2048](https://github.com/sequelize/sequelize/issues/2048)
- [INTERNALS] Replaced lingo with inflection
- [INTERNALS] Removed underscore.string dependency and moved a couple of helper functions from `Utils._` to `Utils`
- [INTERNALS] Update dependencies
+ validator 3.2.0 -> 3.16.1
+ moment 2.5.0 -> 2.7.0
+ generic-pool 2.0.4 -> 2.1.1
+ sql 0.35.0 -> 0.39.0
#### Backwards compatability changes
- We are using a new inflection library, which should make pluralization and singularization in general more robust. However, a couple of pluralizations have changed as a result:
......
......@@ -121,14 +121,23 @@ module.exports = (function() {
uniqueConstraintMapping: {
code: 'SQLITE_CONSTRAINT',
map: function(str) {
var match = str.match(/columns (.*?) are/);
if (match === null || match.length < 2) {
return false;
var match = str.match(/columns (.*?) are/); // Sqlite pre 2.2 behavior - Error: SQLITE_CONSTRAINT: columns x, y are not unique
if (match !== null && match.length >= 2) {
return {
fields: match[1].split(', ')
};
}
return {
fields: match[1].split(', ')
};
match = str.match(/UNIQUE constraint failed: (.*)/); // Sqlite 2.2 behavior - Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: table.x, table.y
if (match !== null && match.length >= 2) {
return {
fields: match[1].split(', ').map(function (columnWithTable) {
return columnWithTable.split('.')[1];
})
};
}
return false;
}
},
......
......@@ -251,6 +251,11 @@ InstanceValidator.prototype._builtinAttrValidate = function(value, field) {
var validators = [];
Utils._.forIn(this.modelInstance.validators[field], function(test,
validatorType) {
if (['isUrl', 'isURL'].indexOf(validatorType) !== -1 && test === true) {
// Preserve backwards compat. Validator.js now expects the second param to isURL to be an object
test = {};
}
// Check for custom validator.
if (typeof test === 'function') {
......@@ -327,12 +332,12 @@ InstanceValidator.prototype._invokeBuiltinValidator = Promise.method(function(va
}
// extract extra arguments for the validator
var validatorArgs = test.hasOwnProperty('args') ? test.args : test;
var validatorArgs = test.hasOwnProperty('args') || test.hasOwnProperty('msg') ? test.args : test;
// extract the error msg
var errorMessage = test.hasOwnProperty('msg') && test.msg ? test.msg :
'Validation ' + validatorType + ' failed';
if (!Array.isArray(validatorArgs)) {
validatorArgs = [validatorArgs];
} else {
......
......@@ -41,32 +41,31 @@
},
"dependencies": {
"dottie": "0.2.4",
"generic-pool": "2.0.4",
"generic-pool": "2.1.1",
"inflection": "^1.3.8",
"lodash": "~2.4.0",
"moment": "~2.5.0",
"moment": "~2.7.0",
"node-uuid": "~1.4.1",
"sequelize-bluebird": "git://github.com/sequelize/bluebird.git#9df139af53c5d346ffd38df30fc9dc60c62a9c98",
"sql": "~0.35.0",
"sql": "~0.39.0",
"toposort-class": "~0.3.0",
"validator": "~3.2.0"
"validator": "~3.16.0"
},
"devDependencies": {
"chai-as-promised": "^4.1.1",
"sqlite3": "~2.1.12",
"mysql": "2.0.1",
"pg": "~2.8.1",
"sqlite3": "~2.2.4",
"mysql": "~2.4.1",
"pg": "~3.4.0",
"watchr": "~2.4.11",
"chai": "~1.9.0",
"mocha": "~1.18.2",
"chai-datetime": "~1.1.1",
"sinon": "~1.8.1",
"mariasql": "0.1.20",
"mocha": "~1.21.3",
"chai-datetime": "~1.2.0",
"sinon": "~1.10.3",
"mariasql": "~0.1.2",
"chai-spies": "~0.5.1",
"lcov-result-merger": "0.0.2",
"istanbul": "~0.2.9",
"coveralls": "~2.10.0",
"async": "~0.2.10",
"lcov-result-merger": "~1.0.0",
"istanbul": "~0.3.0",
"async": "~0.9.0",
"coffee-script": "~1.7.1",
"markdox": "0.1.4",
"sinon-chai": "~2.5.0",
......
......@@ -1000,8 +1000,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
expect(users[0].username).to.equal("Peter")
expect(users[1].username).to.equal("Paul")
expect(moment(users[0].deletedAt).utc().format('YYYY-MM-DD h:mm')).to.equal(date)
expect(moment(users[1].deletedAt).utc().format('YYYY-MM-DD h:mm')).to.equal(date)
expect(moment(new Date(users[0].deletedAt)).utc().format('YYYY-MM-DD h:mm')).to.equal(date)
expect(moment(new Date(users[1].deletedAt)).utc().format('YYYY-MM-DD h:mm')).to.equal(date)
done()
})
})
......
......@@ -135,24 +135,6 @@ describe(Support.getTestDialectTeaser("Migrator"), function() {
})
describe('executions', function() {
it("supports coffee files", function(done) {
var self = this
this.init({
filesFilter: /\.coffee$/,
to: 20111130161100
}, function(migrator) {
self.migrator = migrator
self.migrator.migrate().success(function() {
self.sequelize.getQueryInterface().showAllTables().success(function(tableNames) {
tableNames = tableNames.filter(function(e){ return e != 'SequelizeMeta' })
expect(tableNames).to.eql([ 'Person' ])
done()
})
})
})
})
it("executes migration #20111117063700 and correctly creates the table", function(done) {
this.sequelize.getQueryInterface().showAllTables().success(function(tableNames) {
tableNames = tableNames.filter(function(e){ return e != 'SequelizeMeta' })
......@@ -186,6 +168,23 @@ describe(Support.getTestDialectTeaser("Migrator"), function() {
})
})
it("supports coffee files", function(done) {
var self = this
this.init({
filesFilter: /\.coffee$/,
to: 20111130161100
}, function(migrator) {
self.migrator = migrator
self.migrator.migrate().success(function() {
self.sequelize.getQueryInterface().showAllTables().success(function(tableNames) {
tableNames = tableNames.filter(function(e){ return e != 'SequelizeMeta' })
expect(tableNames).to.eql([ 'Person' ])
done()
})
})
})
})
it("executes the empty migration #20111130161100", function(done) {
this.init({ from: 20111130161100, to: 20111130161100 }, function(migrator) {
// this migration isn't actually testing anything but
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!