Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-11886 - Elaborate Envers documentation and switch to actual sourc…
…e code examples Fix typos. Move schema to external extras files.
- Loading branch information
1 parent
ab98bcb
commit 6ba7420
Showing
3 changed files
with
153 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...tion/src/main/asciidoc/userguide/chapters/envers/extras/envers-generateschema-example.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
create table Address ( | ||
id bigint not null, | ||
city varchar(255), | ||
street varchar(255), | ||
streetNumber varchar(255), | ||
country_id bigint, | ||
primary key (id) | ||
) | ||
|
||
create table Address_AUD ( | ||
id bigint not null, | ||
REV integer not null, | ||
REVTYPE tinyint, | ||
REVEND integer, | ||
city varchar(255), | ||
street varchar(255), | ||
streetNumber varchar(255), | ||
country_id bigint, | ||
primary key (id, REV) | ||
) | ||
|
||
create table Country ( | ||
id bigint not null, | ||
name varchar(255), | ||
primary key (id) | ||
) | ||
|
||
create table Country_AUD ( | ||
id bigint not null, | ||
REV integer not null, | ||
REVTYPE tinyint, | ||
REVEND integer, | ||
name varchar(255), | ||
primary key (id, REV) | ||
) | ||
|
||
create table Customer ( | ||
id bigint not null, | ||
created_on timestamp, | ||
firstName varchar(255), | ||
lastName varchar(255), | ||
address_id bigint, | ||
primary key (id) | ||
) | ||
|
||
create table Customer_AUD ( | ||
id bigint not null, | ||
REV integer not null, | ||
REVTYPE tinyint, | ||
REVEND integer, | ||
created_on timestamp, | ||
firstName varchar(255), | ||
lastName varchar(255), | ||
address_id bigint, | ||
primary key (id, REV) | ||
) | ||
|
||
create table REVINFO ( | ||
REV integer generated by default as identity, | ||
REVTSTMP bigint, | ||
primary key (REV) | ||
) | ||
|
||
alter table Address | ||
add constraint FKpr4rl83u5fv832kdihl6w3kii | ||
foreign key (country_id) | ||
references Country | ||
|
||
alter table Address_AUD | ||
add constraint FKgwp5sek4pjb4awy66sp184hrv | ||
foreign key (REV) | ||
references REVINFO | ||
|
||
alter table Address_AUD | ||
add constraint FK52pqkpismfxg2b9tmwtncnk0d | ||
foreign key (REVEND) | ||
references REVINFO | ||
|
||
alter table Country_AUD | ||
add constraint FKrix4g8hm9ui6sut5sy86ujggr | ||
foreign key (REV) | ||
references REVINFO | ||
|
||
alter table Country_AUD | ||
add constraint FKpjeqmdccv22y1lbtswjb84ghi | ||
foreign key (REVEND) | ||
references REVINFO | ||
|
||
alter table Customer | ||
add constraint FKfok4ytcqy7lovuiilldbebpd9 | ||
foreign key (address_id) | ||
references Address | ||
|
||
alter table Customer_AUD | ||
add constraint FK5ecvi1a0ykunrriib7j28vpdj | ||
foreign key (REV) | ||
references REVINFO | ||
|
||
alter table Customer_AUD | ||
add constraint FKqd4fy7ww1yy95wi4wtaonre3f | ||
foreign key (REVEND) | ||
references REVINFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters