New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soft Deletes #338
Comments
The |
Bad phrasing on my part. So how about:
|
Would it be beneficial to have the deleted column be a DateTime so you can see when it was deleted? |
@headdetect Hadn't thought about that, but yeah, we'll do that. |
Tasking for this -- but this is only a preliminary guess jotted down just to give @nieve a head start if he still wants to do it;)
|
Great stuff, will get cracking 😄 |
@nieve I was thinking two fields, but yeah, deleted_at as a nullable field is probably easier. Another thing I've kicked around on paper is creating a new concept of an
Maybe we could build out those four flavors of IDeleter, and have it determined just once per doc type and used throughout? |
If a document type is so marked, treat deletions of that document as a "soft delete." Maybe have:
That would force Marten to add an additional column to the storage table for "deleted" and make that false by default. We would then need to intercept deletion requests and do it instead by marking the "deleted" column to true.
The DocumentMapping default query filtering would then need to set deleted = false so that normal calls to
session.Query<User>()
would automatically filter out soft deleted documents.Come back with an explicit "session.Query().IncludeDeleted()" that would get you out of the deletions.
The text was updated successfully, but these errors were encountered: