sequelize.js - Node.js, sequelize and Unknown column -
i read similar question: sequelize unknown column '*.createdat' in 'field list'
but solution doesn't work me! why? code:
var user = sequelize.define("user", { id: { type: datatypes.uuid, primarykey: true }, cognome: datatypes.string, nome: datatypes.string, email: datatypes.string, password: datatypes.text, stato: datatypes.integer, ruolo: datatypes.integer }, { freezetablename: true }, { timestamps: false });
the error is:
executing (default): select `id`, `cognome`, `nome`, `email`, `data_nascita`, `password`, `cellulare`, `stato`, `blacklist`, `createdat`, `updatedat` `candidato` `candidato`; unhandled rejection sequelizedatabaseerror: er_bad_field_error: unknown column 'createdat' in 'field list'
instead of passing { timestamps: false }
additional param of sequelize.define
call, should extend existing (third) 1 corresponding property:
var user = sequelize.define("user", { // model definition skipped }, { freezetablename: true, timestamps: false });
... described in the docs.
Comments
Post a Comment