Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase vs Hibernate Envers #99

Closed
mmaask opened this issue Dec 14, 2015 · 4 comments
Closed

Liquibase vs Hibernate Envers #99

mmaask opened this issue Dec 14, 2015 · 4 comments

Comments

@mmaask
Copy link

mmaask commented Dec 14, 2015

A solution was done to provide the generation functionality in #27 #54, but this provides just the default table names. These 3 primary field/table names can be altered from JPA configuration properties using these parameters for example:

  • org.hibernate.envers.audit_table_suffix: _history
  • org.hibernate.envers.revision_field_name: revision
  • org.hibernate.envers.revision_type_field_name: revision_info

Defaults being: _AUD, REV, REVINFO

Generating diff has no idea about these and is using default values still, which always results in new changesets. Can those properties be implemented to have an affect when generating diff? Or is it not controlled by the plugin at all?

Thanks.

┆Issue is synchronized with this Jira Bug by Unito

@Nagendra080389
Copy link

Facing same issue when running on an existing project managed by liquibase. It finds tables, primary keys and foreign keys, but still generates same changesets again. Can this be fixed please?

@crtk
Copy link

crtk commented Sep 6, 2016

Encountered the same issue.
Workaround for now:

  • set @AuditTable for audited entities
  • create a custom revision entity and...
    1. add a @Table name
    2. add a custom @RevisionNumber field (in my case it is the same as @Id)

@MalteKrueger
Copy link

I found another workaroud for this problems searching for a solution to set org.hibernate.envers.global_with_modified_flag and generating diffs with maven.

You can set envers (and probably others too) properties via the environment (i.e. -Dorg.hibernate.envers.global_with_modified_flag=true). Audit_table_prefix and audit_table_sufix also worked.

@filipelautert
Copy link
Collaborator

Seems Malket answer still works, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants