2 ms·
Trivial case I hit: 1) Client wants to remove user from the system who have left their org but 2) There are objects that were contributed by that user which a
by Pxtl 4y ago
Trivial case I hit:
1) Client wants to remove user from the system who have left their org but
2) There are objects that were contributed by that user which are required to persist beyond the user's deletion.
Those are ideal cases for soft deletion. We can still query information about the deleted user to explain who created this object, with the note that their account has been deleted.
Probably I should be doing full event-sourcing for this case, but delete flag works well. MS offers temporal tables for this use case and I'm still considering the implications there -- AFAIK ORM support is WIP.
And unlike the article author, I have used soft deletion to undelete things. Many times. Maybe he has better users than I do, I don't know.
- mixmastamyk 4y agoAnother way to handle is to set each obj.user to a “Deleted User” record.