yozawiratama yozawiratama - 1 year ago 374
Node.js Question

disable updatedAt (update date) field in sequelize.js

i used sequelize-auto to generate schema, and i try to using

and i get this error :

Unhandled rejection SequelizeDatabaseError: Invalid column name 'updatedAt'.

in my database table there is no field

for example my table name is
my code is
, and there are no
field in

db.users= sequelize.import(__dirname + "/models/users");
app.get('/users', function (req, res) {

db.user.findOne().then(function (project) {


how to solve it?

Answer Source

Refer documentation for configuration of Model in Sequelize

In model object of your table should be looks like this.

var user = sequelize.define('user', { /* bla */ }, {
  // don't add the timestamp attributes (updatedAt, createdAt)
  timestamps: false,
  // your other configuration here

Check Usage of sequelize-auto-generation module

  1. Create one json file for all model configuration otpions (flag object as defined here).

  2. When executing command you have to pass -a or --addtional option for that where you have to pass json file configuration path.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download