Re:You might as well timestamp it (2021)
by grahamm on Wednesday December 28, 2022 @02:02PM
(#34164467)
Never really felt the need but I suppose there has always been an updated_when field, so for something that is deleted the updated_when provides the time stamp.
[ Parent
| on HN ]
Re:You might as well timestamp it (2021)
by echelon on Wednesday December 28, 2022 @02:06PM
(#34164530)
Create an `updated_at` with an on update trigger to set it to NOW(). Your code will never have to explicitly remember to set it.
Go further and create an integer `version` vector clock that gets set to its value plus one. You can see the edit frequency of individual entities and construct a simple key for cache invalidation.