View soft-deleted records
Last updated
Last updated
Sequelize supports the concept of paranoid tables. A paranoid table is one that, when told to delete a record, it will not truly delete it. Instead, a special column called deletedAt
will have its value set to the timestamp of that deletion request.
This means that paranoid tables perform a soft-deletion of records, instead of a hard-deletion. By default, Forest Admin hides soft-deleted records. This example will show you how to view soft-deleted records within your Forest Admin interface.
Sequelize hooks are places we can write callbacks that get invoked at key points in time like afterCreate
, afterDestroy
, afterUpdate
, and more.
Here, we'll use beforeFind
and beforeCount
hooks ont our Companies model.
You can also use the option Access to records through Segments only
to separate deleted records from the main table view 👇
For better visibility, you can to display your deleted records.