Hibernate Envers: should dropped columns from the entity be dropped in the audit/history table as well?

219 views Asked by At

If an entity has a column that will be dropped (or in general renamed or changed) with the next release, is it good practice to keep the column in the audit table?

  • If so, over time, this will eventually grow and grow as your entity model changes. Is there a guideline for when to clean this up?
  • If not so, and the column is dropped, you are manipulating history records and are losing data.

And what to do when a column is being changed from data-type (e.g. from VARCHAR to NUMBER)?

Side note: I don't let Hibernate Envers create the columns, but manage them myself with liquibase-scripts. I do wonder what Hibernate Envers would do if the auto ddl options are set.

0

There are 0 answers