Datamapper icon indicating copy to clipboard operation
Datamapper copied to clipboard

Implement soft-delete functionality

Open WanWizard opened this issue 13 years ago • 2 comments

In certain environments, regulations do not allow you to really delete any information.

To facilitate this, DataMapper needs an option to be able to mark records as deleted, and to "hide" these deleted records from every interaction you have with the database.

WanWizard avatar Jul 23 '12 09:07 WanWizard

Note that this must be completely transparent for the application.

The column used in the table to mark the delete state should not be considered a valid column name from the applications point of view. You should not be able to select() it. It should be added as a where() filter to every interaction with every table that has this feature defined. If you set it (as an object property) it should be ignored when compiling SQL. It must be completely hidden.

WanWizard avatar Jul 23 '12 09:07 WanWizard

Got a +1 from @ingdiaz and @tarciozemel

WanWizard avatar Jul 23 '12 10:07 WanWizard