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

Commit 8bbaeac3 by Mick Hansen

[chore] remove enum missing values check from query generator

1 parent e847cd97
Showing with 3 additions and 7 deletions
...@@ -251,13 +251,9 @@ module.exports = (function() { ...@@ -251,13 +251,9 @@ module.exports = (function() {
var template; var template;
if (dataType.type.toString() === DataTypes.ENUM.toString()) { if (dataType.type.toString() === DataTypes.ENUM.toString()) {
if (Array.isArray(dataType.values) && (dataType.values.length > 0)) { template = 'ENUM(' + Utils._.map(dataType.values, function(value) {
template = 'ENUM(' + Utils._.map(dataType.values, function(value) { return this.escape(value);
return this.escape(value); }.bind(this)).join(', ') + ')';
}.bind(this)).join(', ') + ')';
} else {
throw new Error('Values for ENUM haven\'t been defined.');
}
} else { } else {
template = dataType.type.toString(); template = dataType.type.toString();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!