-
Notifications
You must be signed in to change notification settings - Fork 7
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
Deleted by #5
Comments
Heya, I'm not sure off-hand, but my gut feeling would be that to do that it may be better to explicitly soft-delete the model using The soft-deleted models would still be excluded by this library, but yeah I'm not sure how to customize the delete behaviour in a non-global way that is better than using an update. Would you be able to give me an example of what you would like to achieve? There may be some better solution than I can think of right now. |
The idea is to basically track who (which user) deleted something and when they did this. I can obviously do it in the service layer, but I feel like moving it down as much as possible would be the safest way to ensure, it's always written. |
Sorry to interrupt. What @razzeee is interested in is not the "deletion" but the "event occurrence" of the deletion, right? prisma-soft-delete-middleware is a middleware about logical deletion, and if you ask for functions that have nothing to do with it, prisma-soft-delete-middleware will become something that you don't understand. At the moment, Prisma itself seems to lack the functionality to do anything too complicated, which is why there seems to be no Audit middleware. |
If we design the table to have a column called So, instead of thinking in terms of However, if it is a small application, it is too much of an exaggeration to create a new |
Those are valid thought and actually inspire me, but I don't have most of those problems (yet) Yes, it's audit (or well GDPR) functionality. But as far as I'm aware all our historical tables already have to enforce, that there are no updates. So we always delete and create a new entry. And every table we have, already has an Anyway, not sure, if a |
Can you see this somehow handling a call to delete and additionally adding a userId, that will be linked to another table?
The text was updated successfully, but these errors were encountered: