Frage

We are using Envers with both Oracle and MySQL without any problem. We are now trying PostgreSQL but we have the problem that the audit tables are created with a column REVTYPE of type TINYINT.

TINYINT is not supported by PostgreSQL.

Is there a way to change the type of REVTYPE?

Example:

create table AUD_SomeTable (
  dbId bigint not null,
  ...
  REV integer not null,
  REVTYPE tinyint,
  primary key (dbId, REV)
);

EDIT:

Problem solved: I forgot the change the Hibernate dialect.

War es hilfreich?

Lösung

I don't know about about Envers, but you could create a new domain type.

CREATE DOMAIN "tinyint"
  AS smallint;

You can add CONSTRAINS to check for e.g. a postive value.

Andere Tipps

You should test whether this is really an Envers issue or an Hibernate issue. Try mapping an entity with a property byte type using hibernate only. If it tries to generate a tinyint column it would be a Hibernate issue.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top