【问题标题】:Envers: How to add a new column in *_AUD table (not in REVINFO table)Envers:如何在 *_AUD 表中添加新列(不在 REVINFO 表中)
【发布时间】:2015-12-08 12:24:15
【问题描述】:

对于每个被审计的实体,envers 创建一个带有 *_AUD 后缀的表。

每个表都有 两个 额外的列(REVrevtype)。

我只想动态创建一个新的一列来满足我的额外需求。

Obs:手动创建新列,因为所有实体中的新字段不适合我。

这可能吗?

【问题讨论】:

  • 有什么问题?为什么alter table mytable add column mycolumn 不可接受?
  • @DraganBozanovic 我想做类似@RevisionEntity 之类的事情,但要在审核实体表中添加动态字段/列,而不是在 REVINFO 表中。

标签: hibernate hibernate-envers audit-tables


【解决方案1】:

您可以尝试创建一个脚本并在此基础上添加您想要的列:

spool c:\osama.log

select  'audit'||' ' || 'alter' || 'table' || ' '|| OWNER|| '.'||' '|| OBJECT_NAME|| ' '|| 'by access;' where owner='<user-name>';

Spool Off ;

通过此链接查看页面的其余部分:https://community.oracle.com/thread/2455981

【讨论】:

    猜你喜欢
    • 2020-01-03
    • 2014-12-01
    • 2016-02-03
    • 2020-09-23
    • 2021-07-17
    • 2017-02-24
    • 1970-01-01
    • 2014-07-03
    • 2015-05-05
    相关资源
    最近更新 更多