use column default for not null prop

This commit is contained in:
biniam 2017-06-07 09:57:21 -04:00
parent 7e15bd567d
commit 1626141abf
1 changed files with 8 additions and 0 deletions

View File

@ -1114,9 +1114,17 @@ SQLConnector.prototype._buildWhere = function(model, where) {
// Column value is a list
for (var j = 0, m = expression.length; j < m; j++) {
columnValue.push(this.toColumnValue(p, expression[j]));
if (columnValue[j].sql && columnValue[j].sql.match(/DEFAULT\(\?\)/)) {
columnValue[j].params.pop();
columnValue[j].params.push(columnName);
}
}
} else {
columnValue.push(this.toColumnValue(p, expression));
if (columnValue.sql && columnValue.sql.match(/DEFAULT\(\?\)/)) {
columnValue.params.pop();
columnValue.params.push(columnName);
}
}
if (operator === 'between') {
// BETWEEN v1 AND v2