create table EVENTS ( id bigint not null, EVENT_DATE timestamp, title varchar(255), primary key (id) ); create table EVENTS_AUD ( id bigint not null, REV integer not null, REVTYPE tinyint, EVENT_DATE timestamp, title varchar(255), primary key (id, REV) ); create table REVINFO ( REV integer generated by default as identity, REVTSTMP bigint, primary key (REV) ); alter table EVENTS_AUD add constraint FK5cembm6xahf542q8e4h0pq2t1 foreign key (REV) references REVINFO;