LanguageAudit tables
Audit tables
audit envers(...) after a table's closing brace declares the audit tables Hibernate Envers keeps for it.
table orders { id bigint pk user_id bigint status varchar enum(PENDING, PAID, CANCELED) created_at datetime updated_at datetime } audit envers(user_id, status)
What gets generated
orders_audholds the primary key,rev,revtypeand the listed columns.audit enverswith no list audits every column except the primary key,created_atandupdated_at.- As soon as one table is audited, a
revinfotable is generated, with a relation to every*_audtable.
Declaring revinfo or <table>_aud yourself is an error, since resin generates them. audit needs a primary key, and external tables cannot be audited. envers is the only method so far.
In the diagram
By default the audit tables are folded into an ENVERS tag on the audited table. Turn on Audit tables in the playground, or pass --expand-audit on the command line, to draw revinfo and the *_aud tables.