0

I originally loaded some data through a liquibase script, and this has resulted in the envers audit table missing the insert records. So while I have update records, I do not have original insert records

I've written a data script to reinsert this data with the create records - but it is a fairly heavy weight script as you have to consider 4 scenarios -

  • Data with existing insert records - no migration
  • Data with update/delete records but no insert records - need insert records
  • Data with no audit entries - this is bulk upload without any subsequent changes
  • Reset Existing records

The scripts written, but is there an easier way to do this? Or did I just mess up not creating the initial insert records?

Im guessing you dont need the update/delete records - but I am using the audit table in a view

Thanks

farrellmr
  • 1,815
  • 2
  • 15
  • 26

1 Answers1

0

Do you need to keep old update/delete audit records? If not - and it's ok to "start over" in auditing - you can simply remove all present audit history. Then "move" all present state to audit records as inserts pointing to revision 1 .

Roger
  • 1,944
  • 1
  • 11
  • 17
  • I need to keep them for the moment - there will be a policy on this in the future but for the moment i need to keep them. Like I say Ive written the scripts - but am wondering if there is an easier way. Thanks for your help – farrellmr Mar 15 '18 at 09:53