Implementing Soft-Delete across an entire database using PostgreSQL
I am facing the task of implementing soft-deletion across our entire database. As of now, the only approach I know of is to add a new column (e.g.: isDeleted
) to every table. Maintaining this is pretty unpleasant since you have to deal with checking whether a record that you want to query is deleted or not aswell as implementing your own cascading logic. Furthermore you have to deal with checking whether a referenced record is not deleted when working with foreign-keys.