Added script to check outcome of the hibernate-tutorials
[hibernate4-maven-plugin] / src / it / tutorials / schema-envers.sql
1
2     drop table EVENTS if exists;
3
4     drop table EVENTS_AUD if exists;
5
6     drop table REVINFO if exists;
7
8     create table EVENTS (
9         id bigint not null,
10         EVENT_DATE timestamp,
11         title varchar(255),
12         primary key (id)
13     );
14
15     create table EVENTS_AUD (
16         id bigint not null,
17         REV integer not null,
18         REVTYPE tinyint,
19         EVENT_DATE timestamp,
20         title varchar(255),
21         primary key (id, REV)
22     );
23
24     create table REVINFO (
25         REV integer generated by default as identity,
26         REVTSTMP bigint,
27         primary key (REV)
28     );
29
30     alter table EVENTS_AUD 
31         add constraint FK_3hegaqrrpmx0jj0c8qacjtira 
32         foreign key (REV) 
33         references REVINFO;