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