Reputation: 3420
I need to change default timestamp createdAt
and modifiedAt
field names for model in sequelize.
They should just be changed to created
and modified
.
I know that I should be able to disable timestamps, then use custom-ones, but I'm not trying to do that I want to override/change default behavior of timestams, because of built-in functionality.
And I can't find it anywhere in sequelize doc.
Upvotes: 0
Views: 816
Reputation: 22758
You can do this, see this example:
// model definition
...
// model options
{
tableName: 'my_table',
createdAt: 'created',
updatedAt: 'modified',
schema: 'public'
}
Upvotes: 1