[bug] Model.timestamps didn't init correct while use `static attributes` to define a model
JimmyDaddy opened this issue · comments
JimmyDaddy commented
class Book extends Bone {
static attributes = {
isbn: { type: BIGINT, primaryKey: true },
name: { type: STRING, allowNull: false },
price: { type: DECIMAL(10, 3), allowNull: false },
created_at: { type: DATE },
updated_at: { type: DATE },
deleted_at: { type: DATE },
}
}
console.log(Book.timestamps);
// {}
class Book extends Bone {
static attributes = {
isbn: { type: BIGINT, primaryKey: true },
name: { type: STRING, allowNull: false },
price: { type: DECIMAL(10, 3), allowNull: false },
createdAt: { type: DATE },
updated_at: { type: DATE },
deleted_at: { type: DATE },
}
}
console.log(Book.timestamps);
// { createdAt: 'createdAt' }