ForestAdmin / lumber

Install Forest Admin in minutes.
https://www.forestadmin.com
MIT License
2.08k stars 106 forks source link

fix(models): enforce string type for default value when 'NULL' #470

Closed guillaumedeslandes closed 4 years ago

guillaumedeslandes commented 4 years ago

Some "NULL" where included in models without quoting due to non-string type for database fields.

eg: DB column type numeric(12,2) and default value NULL::numeric.

Linked to: CU-78nvya

Pull Request checklist:

arnaudbesnier commented 4 years ago

Task linked: CU-78nvya P1 - Lumber Analyzer generates models where fields have a defaultValue equal to NULL - not accepted by Sequelize.Model

slimee commented 4 years ago

It works as expected I guess:

Screenshot 2020-09-16 at 16 58 27
slimee commented 4 years ago

You can edit, and null values from db display empty cell.

But when you create a record without specifying a value for a numeric/default null field, it display NaN instead of displaying an empty cell.

Screenshot 2020-09-16 at 17 00 51
forest-bot commented 4 years ago

:tada: This PR is included in version 3.6.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket: