BuildForSDGCohort2 / e-CareBe

0 stars 7 forks source link

Column names with underscore turns out to be in camelCase #20

Closed Wachiye closed 4 years ago

Wachiye commented 4 years ago

I have been testing my api for updating user details but the error response from database is that the column "updatedAt" does not exist. I do expect sequelize to find the column as "updated_at". I have tried adding the config.define={ "timestamps":true, "createdAt":"created_at", "updatedAt":"updated_at} in the index.js file in the models folder only to get an error in the query which reads the "updated_at" column as is in the database but the value being assigned to CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAP

Wachiye commented 4 years ago

Solved. Justed enabled underscored