Function: UpdatedAt()
UpdatedAt(
columnName?):PropertyDecorator
Defined in: src/decorators/UpdatedAt.ts:14
Property decorator indicating that this field is auto-updated with current timestamp (new Date()) on INSERT and UPDATE.
Parameters
| Parameter | Type | Description |
|---|---|---|
columnName? | string | Optional custom database column name. |
Returns
PropertyDecorator
Usecase
Automatically track when records were last modified in the database.
Example
@UpdatedAt()
updatedAt!: Date;