forest-express-sequelize
forest-express-sequelize copied to clipboard
[*] Charts - Charts may have wrong field mapping field to sequelize model.
Steps to reproduce
- Map the model attribute
createdAtto fieldcreated_at - Create line dashboard grouping by createdAt attribute
Expected behavior
Dashboard show no error.
Actual behavior
Dashboard show error SQLITE_ERROR: no such column: User.createdAt
Failure Logs
[forest] 🌳🌳🌳 Unexpected error: SQLITE_ERROR: no such column: User.createdAt
SequelizeDatabaseError: SQLITE_ERROR: no such column: User.createdAt
Context
I think that's because of this line https://github.com/ForestAdmin/forest-express-sequelize/blob/c51a60694d5e6809bc471108f9ad7098e814d114/services/line-stat-getter.js#L25-L26
It straight getting the column name from models attribute name, instead of the field option.
- Package Version: 3.2.3
- Express Version: 4.16.2
- Sequelize Version: 4.41.2
- Database Dialect: sqlite
- Database Version:
Hi @Jekiwijaya, Thank you for the feedback. We'll try to look at your PR this week.