Add support for size attribute for float and decimal types.#277
Add support for size attribute for float and decimal types.#277moisesrodriguez wants to merge 3 commits intobalderdashy:masterfrom
Conversation
|
@mikermcneil continuing the conversation from Gitter.
Not sure how current auto-migration setting currently works. But I don't think this specific change should break anything of that. If you guys could take a look and if it's something that can be implemented without breaking anything it would be great if this get's merged. If not I'll wait until until it is it's own hook and we can implement it. |
I've tested these in this repo with unit tests and it works. However, something I noticed is that even thought in this repo
sails-mysqlDECIMAL support is there. When I test on my local box with sails, every time I set an attribute to type to DECIMAL by the time it reaches sails-mysql/lib/sql.js the type is STRING instead of DECIMAL. Not sure what is going on there.DECIMAL type is a must for storing monetary values. Not sure why at least from looking at the docs, it's not supported. Since the floating-point (approximate value) types are FLOAT, REAL, and DOUBLE, which they do some rounding. The fixed-point (exact value) types are INTEGER, SMALLINT, DECIMAL, and NUMERIC