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

Commit ff83d129 by Joel Trost Committed by Matt Broadstone

More exclusion of cascade contraints

1 parent 1bcb67ce
Showing with 4 additions and 4 deletions
......@@ -342,8 +342,7 @@ module.exports = (function() {
var casKey = cascadeCheck[i];
for(var j = i+1; j < cascadeCheck.length; j++){
var casKey2 = cascadeCheck[j];
if(attributes[casKey].references === attributes[casKey2].references
&& attributes[casKey].referencesKey === attributes[casKey2].referencesKey){
if(attributes[casKey].referencesKey === attributes[casKey2].referencesKey){
console.warn('MSSQL does not support multiple cascade keys on the same reference, '
+ 'we will removing them to make this work but we recommend restructuring your query.');
attributes[casKey].onDelete = '';
......@@ -429,13 +428,14 @@ module.exports = (function() {
}
// add 1st string as quoted, 2nd as unquoted raw
var sql = (i > 0 ? SqlGenerator.quoteIdentifier(tableNames.join('.')) + '.' : '') + this.quote(obj[i], parent, force);
var sql = (i > 0 ? SqlGenerator.quoteIdentifier(tableNames.join('.')) + '.' : '')
+ this.quote(obj[i], parent, force);
if (i < len - 1) {
sql += ' ' + obj[i + 1];
}
return sql;
} else if (obj._modelAttribute) {
return SqlGenerator.quoteIdentifer(obj.Model.name) + '.' + obj.fieldName;
return SqlGenerator.quoteIdentifier(obj.Model.name) + '.' + obj.fieldName;
} else if (obj._isSequelizeMethod) {
return this.handleSequelizeMethod(obj);
} else if (Utils._.isObject(obj) && 'raw' in obj) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!