我们有一个应用程序已经在生产,它使用Envers做审计。
We have an application that is already in production and it is using Envers to do auditing.
现在我们要释放我们审计了一种新的实体的更新。然而该实体已存在在生产环境中,只有它未经审计为止。
Now we are going to release an update in which we audit a new kind of entity. However this entity already exists in the production environment, only it was not audited so far.
我们已经尝试在包含existings记录的测试环境,并且它崩溃在保存,因为Envers找不到previous修订实体被保存。
We have tried in a test environment containing existings records, and it crashes upon saving because Envers cannot find a previous revision for the entity being saved.
什么是takle这个问题的方法呢?
What is the approach to takle this issue ?
这将是巨大的,例如,如果人们可以从指定一个实体应该被审核的日期。
It would be great for instance if one could specify the date from which an entity should be audited.
您必须手动,写了下面的脚本。应该不是那么难,只需要创建一个单独的行中的修订表,并写上插入审核记录本次修订对你所有的审计单位。
You have to, manually, write a script for this. Shouldn't be that hard, just create a single row in your revision table and write "insert audit records" for this revision for all your audited entities.