Closed soyniqolas closed 4 years ago
UPDATE: Also needs to add "UNSIGNED" if is the case.
if (attr.match(/^(float8|double precision|double|numeric)/)) {
let type = 'DataTypes.DOUBLE';
const unsigned = attr.match(/unsigned/i);
if (unsigned) {
type += '.UNSIGNED';
}
return type;
}
Thanks! I fixed this issue. And integer, bigint, float and double support unsigned and zerofill properties, but PostgreSQL dose not.
Hi ! I'm trying to map a MySQL database into NodeJS models, but in one of the tables I get the next error:
So, I dug a bit into the source code and I discovered that when a column has a data type of "double unsigned" sequelize-automate doesn't recognize it. Example:
To fix this I just modified the attr.match to add "double" into the file /src/util/definition.js, at line 170, like this:
Before:
After:
After this modification I don't get that error and the mapping works fine.