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

Commit 1889d80c by Mick Hansen

Merge pull request #480 from alexyoung/master

Add DECIMAL data type support (thanks to @alexyoung)
2 parents 35fe16f5 757da44f
Showing with 25 additions and 0 deletions
......@@ -8,5 +8,12 @@ module.exports = {
FLOAT: 'FLOAT',
NOW: 'NOW',
ENUM: 'ENUM',
get DECIMAL() {
var ret = function(precision, scale) {
return 'DECIMAL(' + precision + ',' + scale + ')';
};
ret.toString = ret.valueOf = function() { return 'DECIMAL'; };
return ret;
},
ARRAY: function(type) { return type + '[]' }
}
if(typeof require === 'function') {
const buster = require("buster")
, Sequelize = require("../index")
, Helpers = require('./buster-helpers')
, dialect = Helpers.getTestDialect()
}
buster.spec.expose()
describe(Helpers.getTestDialectTeaser('Data types'), function() {
it('should return DECIMAL for the default decimal type', function() {
expect(Sequelize.DECIMAL).toEqual('DECIMAL');
});
it('should return DECIMAL(10,2) for the default decimal type with arguments', function() {
expect(Sequelize.DECIMAL(10, 2)).toEqual('DECIMAL(10,2)');
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!