forest-express-sequelize icon indicating copy to clipboard operation
forest-express-sequelize copied to clipboard

Camelcase Name not found

Open laruche opened this issue 5 years ago • 5 comments

Hi team, I have an issue on camelcase usage on Model definition

I work with PSql & Sequelize My models are defined like this .

createdAt: { type: DataTypes.DATE, allowNull: true, field: 'created_at', defaultValue: sequelize.fn('NOW') }

When I use my controllers, I have no issue, but with forest i'v got this error :

[forest] 🌳🌳🌳 Unexpected error: column Consumer.createdAt does not exist SequelizeDatabaseError: column Consumer.createdAt does not exist at Query.formatError (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/sequelize/lib/dialects/postgres/query.js:363:16) at query.catch.err (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/sequelize/lib/dialects/postgres/query.js:86:18) at tryCatcher (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/promise.js:517:31) at Promise._settlePromise (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/promise.js:574:18) at Promise._settlePromise0 (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/promise.js:619:10) at Promise._settlePromises (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/promise.js:695:18) at _drainQueueStep (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/async.js:138:12) at _drainQueue (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/async.js:131:9) at Async._drainQueues (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/async.js:147:5) at Immediate.Async.drainQueues [as _onImmediate] (/Users/laruche/Sites/carrefourX/API/node_rest_api_mysql/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:763:18) at tryOnImmediate (timers.js:734:5) at processImmediate (timers.js:716:5) at process.topLevelDomainCallback (domain.js:101:23)

It's look like a quote error in sequelize / forest implementation

https://github.com/sequelize/sequelize/issues/2495

laruche avatar Jun 24 '19 13:06 laruche

Hi @laruche,

Could you detail if this issue happens when listing/requesting records or when displaying charts? I am trying to understand if the implemented pull request really fixes your issue.

Thanks for your help.

arnaudbesnier avatar Jul 07 '19 21:07 arnaudbesnier

Hello

This bug appear when i displayîng chart only

laruche avatar Jul 07 '19 21:07 laruche

Will be fixed by this PR: https://github.com/ForestAdmin/forest-express-sequelize/pull/301

VincentMolinie avatar Aug 06 '19 08:08 VincentMolinie

Nice :) Time to release ?

laruche avatar Aug 06 '19 08:08 laruche

@laruche we will close the issue and ping you as soon as it is released ;)

VincentMolinie avatar Aug 07 '19 11:08 VincentMolinie