Added tutorials of the hibernate-release 5.0.12.Final
[hibernate4-maven-plugin] / src / it / hibernate4-maven-plugin-envers-sample / create-tables-hsqldb.sql
1 create sequence TTL_AUDIT_REVISION_SEQ start with 1 increment by 10;
2 create sequence TTL_EVENT_SEQ start with 1 increment by 10;
3
4     create table TTL_AUDIT_REVISION (
5         ID bigint not null,
6         EVENT_DATE timestamp,
7         ENVERS_TSTAMP bigint not null,
8         USER_NAME varchar(80) not null,
9         primary key (ID)
10     );
11
12     create table TTL_EVENT (
13         ID bigint not null,
14         EVENT_DATE timestamp not null,
15         TITLE varchar(80) not null,
16         primary key (ID)
17     );
18
19     create table TTL_EVENT_AUD (
20         ID bigint not null,
21         REV bigint not null,
22         REVTYPE tinyint,
23         EVENT_DATE timestamp,
24         TITLE varchar(80),
25         primary key (ID, REV)
26     );
27
28     alter table TTL_EVENT_AUD 
29         add constraint FK295td34se5kaxwgo8i1ph0k4 
30         foreign key (REV) 
31         references TTL_AUDIT_REVISION;