diff --git a/lib/discovery.js b/lib/discovery.js index 5e9e7a4..58376c7 100644 --- a/lib/discovery.js +++ b/lib/discovery.js @@ -349,6 +349,9 @@ function mixinDiscovery(MySQL, mysql) { case 'FLOAT': case 'DOUBLE': case 'BIGINT': + case 'INTEGER': + case 'DECIMAL': + case 'NUMERIC': return 'Number'; case 'DATE': case 'TIMESTAMP': diff --git a/test/datatypes.test.js b/test/datatypes.test.js index d3611e6..524b71d 100644 --- a/test/datatypes.test.js +++ b/test/datatypes.test.js @@ -57,6 +57,22 @@ describe('MySQL specific datatypes', function() { Account.destroyAll(done); }); + it('discover type of amount', function(done) { + db.discoverModelProperties('Account', {}) + .then(function(defs) { + defs.forEach(function(props) { + if (props.columnName === 'amount') { + assert.deepEqual(props.dataType, 'decimal'); + assert.deepEqual(props.type, 'Number'); + done(); + } + }); + }) + .catch(function(err) { + done(err); + }); + }); + it('create an instance', function(done) { Account.create(data, function(err, result) { if (err) return done(err);