i used sequelize-auto to generate schema, and i try to using
findOne()
Unhandled rejection SequelizeDatabaseError: Invalid column name 'updatedAt'.
updatedAt
Users
Users.findOne()
updatedAt
users
db.users= sequelize.import(__dirname + "/models/users");
app.get('/users', function (req, res) {
db.user.findOne().then(function (project) {
res.json(project);
})
});
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
Create one json file for all model configuration otpions (flag object as defined here).
When executing command you have to pass -a
or --addtional
option for that where you have to pass json file configuration path.