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

Commit 7949f932 by Joel Trost Committed by Matt Broadstone

Tweaks to cascading

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