by kstrauser · 3y ago · 0 comments
> "items in the deleted state must have a deleted time"
I much prefer making it impossible to represent bad state, like rephrasing at as "items are deleted if their deleted_time property is set". In this case, that makes the deletion atomic: there's never an instant where it's ambiguous if the object was deleted.
That doesn't disagree with his premise. It's an additional recommendation.
In such cases I fall back to computed columns. A deleted flag which value depends on deleted_time being set or not, for example. This retains your atomic state goal.