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

Commit 6426c53f by Victor Zeng Committed by Mick Hansen

smartWhere doesn't really for this place

1 parent 612d23b3
Showing with 9 additions and 1 deletions
...@@ -538,6 +538,14 @@ module.exports = (function() { ...@@ -538,6 +538,14 @@ module.exports = (function() {
delete options.type; delete options.type;
} }
if (options.where) {
if (Array.isArray(options.where)) {
options.where = Utils.format(options.where);
} else if (!String.isString(options.where)) {
delete options.where
}
}
return Utils._.compact([ return Utils._.compact([
'CREATE', 'CREATE',
options.unique ? 'UNIQUE' : '', options.unique ? 'UNIQUE' : '',
...@@ -549,7 +557,7 @@ module.exports = (function() { ...@@ -549,7 +557,7 @@ module.exports = (function() {
this._dialect.supports.index.using === 2 && options.using ? 'USING ' + options.using : '', this._dialect.supports.index.using === 2 && options.using ? 'USING ' + options.using : '',
'(' + fieldsSql.join(', ') + (options.operator ? ' '+options.operator : '') + ')', '(' + fieldsSql.join(', ') + (options.operator ? ' '+options.operator : '') + ')',
(this._dialect.supports.index.parser && options.parser ? 'WITH PARSER ' + options.parser : undefined), (this._dialect.supports.index.parser && options.parser ? 'WITH PARSER ' + options.parser : undefined),
(this._dialect.supports.index.where && options.where ? 'WHERE ' + Utils.smartWhere(options.where) : undefined) (this._dialect.supports.index.where && options.where ? 'WHERE ' + options.where : undefined)
]).join(' '); ]).join(' ');
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!