Frage

1) Is there any way to limit the scope of an Envers audit trail?

We have a need for 1 week of audit trails for which Envers is a perfect fit, but we also have some contractual obligations around data retention beyond that timeframe.

1.1) Is it possible to configure envers to truncate its _AUD table based on revisionTime?

1.2) Will hibernate crumble or grumble if I use a timed query to remove the data from the database directly? Or is there an alternative, API-friendly way to remove audit history?

War es hilfreich?

Lösung

1.1) No

1.2) No; the revisions table always has a timestamp, you can use it to remove data. If you have on_delete cascades and the generated schema has them (it usually should), simply removing the old revisions should be enough. All the audit data should be removed (there are constraints on the revision number field in the _aud tables)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top