I like what the article says about "giving a correct interpretation of
user’s intention". I don't know if that warrants two fields (i.e.
deleted_at and reason), or just one context-sensitive field (e.g.
canceled_at). I guess in some cases there could be multiple reasons
for "deleting" something, but I think that would be rare.
But having a consistently named field like deleted_at makes it easy
for something like ActiveRecord to handle the exclusions
behind-the-scenes without any per-model config. But at the same time
having a semantic name for your field is... semantic.
That was a very long way to say I don't know.
--
Justin Blake
http://blog.adsdevshop.com/
On Sep 11, 7:20 am, Tim Rosenblatt <t...@timrosenblatt.com> wrote:
> Hey all, I read this article on deleting data from a database, and it seemed
> worth passing along
> http://www.infoq.com/news/2009/09/Do-Not-Delete-Data
> We had a discussion on this at standup yesterday, and it was suggested that
> it might be worth tracking the reason why a record was deleted (like a state
> machine), as well as a deleted_at timestamp.
> Thoughts?
> --
> Tim Rosenblatthttp://www.timrosenblatt.com