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

Commit 7949f932 by Joel Trost Committed by Matt Broadstone

Tweaks to cascading

1 parent ab268e4a
......@@ -615,17 +615,19 @@ module.exports = {
}
//PROBLEM WITH THIS IS MSSQL DOES NOT ALLOW MULTIPLE PER KEY
// if (attribute.onDelete) {
// if(attribute.onDelete.toUpperCase() !== 'RESTRICT'){
// template.push(attributeMap.onDelete);
// template.push(attribute.onDelete.toUpperCase());
// }
// }
// if (attribute.onUpdate) {
// template.push(attributeMap.onUpdate);
// template.push(attribute.onUpdate.toUpperCase());
// }
if((attribute.onDelete && !attribute.onUpdate) || (!attribute.onDelete && attribute.onUpdate)){
if (attribute.onDelete) {
if(attribute.onDelete.toUpperCase() !== 'RESTRICT'){
template.push(attributeMap.onDelete);
template.push(attribute.onDelete.toUpperCase());
}
}
if (attribute.onUpdate) {
template.push(attributeMap.onUpdate);
template.push(attribute.onUpdate.toUpperCase());
}
}
}
return template.join(' ');
......
......@@ -2,6 +2,7 @@ var chai = require('chai')
, expect = chai.expect
, Sequelize = require(__dirname + '/../index')
, Support = require(__dirname + '/support')
, dialect = Support.getTestDialect()
chai.config.includeStack = true
......@@ -104,6 +105,9 @@ describe(Support.getTestDialectTeaser('DataTypes'), function() {
tests.forEach(function(test) {
it('transforms "' + test[1] + '" to "' + test[2] + '"', function(done) {
if(dialect === 'mssql' && test[1] ==='STRING'){
test[2] = 'NVARCHAR(255)';
}
expect(test[0].toString()).to.equal(test[2])
done()
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!