Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*] Charts - Charts may have wrong field mapping field to sequelize model. #282

Open
Jekiwijaya opened this issue Jul 2, 2019 · 1 comment
Labels

Comments

@Jekiwijaya
Copy link

Jekiwijaya commented Jul 2, 2019

Steps to reproduce

  1. Map the model attribute createdAt to field created_at
  2. 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

var fieldName = params['group_by_date_field'];
return schema.name + '.' + fieldName;

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:
Jekiwijaya added a commit to Jekiwijaya/forest-express-sequelize that referenced this issue Jul 2, 2019
… option

access the schema field columnName instead access directly through the fieldName.

Closed ForestAdmin#282
Closed ForestAdmin#273
@arnaudbesnier arnaudbesnier changed the title Dashboard has wrong field mapping field to sequelize model. [*] Charts - Charts may have wrong field mapping field to sequelize model. Jul 7, 2019
@arnaudbesnier
Copy link
Member

Hi @Jekiwijaya,
Thank you for the feedback.
We'll try to look at your PR this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants