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

Commit 7a82da2c by Mick Hansen

fix(data-types): fix regression with DECIMAL(N, undefined). closes #3119

1 parent 94b9eed9
# Next
- [BUG] Fixed regression with `DataTypes.ARRAY(DataTypes.STRING(length))` #3106
- [BUG] Fixed regression where `.or([{key: value}, {key: value, key2: value}])` would result in 3 `A OR B OR C` rather than `A OR (B AND C)` #3107
- [BUG] Fixed regression with `DataTypes.DECIMAL(10)` resulting in `10, undefined` #3119
# 2.0.1
- [BUG] Fixed issue with empty `include.where`
......
'use strict';
var util = require('util');
var util = require('util')
, _ = require('lodash');
var ABSTRACT = function(options) {
......@@ -204,7 +205,7 @@ util.inherits(DECIMAL, NUMBER);
DECIMAL.prototype.key = DECIMAL.key = 'DECIMAL';
DECIMAL.prototype.toSql = function() {
if (this._precision || this._scale) {
return 'DECIMAL(' + this._precision + ',' + this._scale + ')';
return 'DECIMAL(' + [this._precision, this._scale].filter(_.identity).join(',') + ')';
}
return 'DECIMAL';
......
......@@ -254,6 +254,9 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
default: 'DECIMAL(10,2)'
});
testsql('DECIMAL(10)', DataTypes.DECIMAL(10), {
default: 'DECIMAL(10)'
});
});
suite('BLOB', function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!