4 ms·
IDK. I think people can overthink the problem a bit. I done the is_deleted flag with a deleted_at timestamp that gets cascaded down the table relations. Restor
by gonzo41 2y ago
IDK. I think people can overthink the problem a bit.
I done the is_deleted flag with a deleted_at timestamp that gets cascaded down the table relations. Restoring is an admin job and the logic is to follow the table relations down again restoring linked objects with the same deleted_at timestamp.
I have this in a metadata database that controls a data warehouse. Accidentally knocking out a metadata record could nuke large parts of the warehouse so i have to have this and a locked flag that prevents records from being removed or even soft deleted once data is in the warehouse.
- namaria 2y ago> I think people can overthink the problem a bit. > I have this in a metadata database that controls a data warehouse. Accidentally knocking out a metadata record could nuke large parts of the warehouse I think you might be underthinking your problem.
- gonzo41 2y agoI don't have problems with that, we have effective controls. But the warehouse data requires context, and that's supplied via our metadata db. Once metadata starts having actual records associated with it you can't remove it, or you just end up storing junk.
- hi-v-rocknroll 2y agoNullable deleted_at suffices. There is no need for an is_deleted flag.