Automatically update created_at
& updated_at
timestamp columns on update
#827
Milestone
created_at
& updated_at
timestamp columns on update
#827
Motivation
This is a common feature for an ORM. Which "touch" these timestamp columns to record the last update timestamp and create at timestamp of a row.
Proposed Solutions
User can enable this feature by placing attribute on the corresponding field in the entity model.
For insert, the value of both
updated_at
andcreated_at
will be set toCURRENT_TIMESTAMP
.For update, the value of
updated_at
will be set toCURRENT_TIMESTAMP
.User can override this behaviour by setting the value of it explicitly, i.e.
Set(xxx)
.Additional Information
Related Discussions:
The text was updated successfully, but these errors were encountered: