diff --git a/ebean-core/src/test/ddl-review/h2-create-all.sql b/ebean-core/src/test/ddl-review/h2-create-all.sql index dc5f4879f..50d49a3ac 100644 --- a/ebean-core/src/test/ddl-review/h2-create-all.sql +++ b/ebean-core/src/test/ddl-review/h2-create-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2020-12-07T09:40:50.461215Z +-- Generated by ebean unknown at 2021-02-12T03:32:14.253435800Z create table asimple_bean ( id bigint generated by default as identity not null, name varchar(255), @@ -486,6 +486,13 @@ create table child_person ( constraint pk_child_person primary key (identifier) ); +create table child_with_cache ( + id bigint generated by default as identity not null, + name varchar(255), + address varchar(255), + constraint pk_child_with_cache primary key (id) +); + create table cke_client ( cod_cpny integer not null, cod_client varchar(100) not null, @@ -1168,6 +1175,12 @@ create table ebasic_json_unmapped ( constraint pk_ebasic_json_unmapped primary key (id) ); +create table e_basic_log ( + id bigint generated by default as identity not null, + name varchar(255), + constraint pk_e_basic_log primary key (id) +); + create table e_basic_ndc ( id integer generated by default as identity not null, name varchar(255), @@ -1227,6 +1240,14 @@ create table e_basic_with_ex ( constraint pk_e_basic_with_ex primary key (id) ); +create table e_basic_withlog ( + id bigint generated by default as identity not null, + name varchar(255), + deleted boolean default false not null, + version bigint not null, + constraint pk_e_basic_withlog primary key (id) +); + create table e_basicverucon ( id integer generated by default as identity not null, name varchar(127), @@ -2256,6 +2277,29 @@ create table looney ( constraint pk_looney primary key (id) ); +create table m2_mcache_child ( + id integer generated by default as identity not null, + name varchar(255), + constraint pk_m2_mcache_child primary key (id) +); + +create table m2_mcache_master ( + id integer generated by default as identity not null, + constraint pk_m2_mcache_master primary key (id) +); + +create table m2mcache_set1 ( + m2_mcache_master_id integer not null, + m2_mcache_child_id integer not null, + constraint pk_m2mcache_set1 primary key (m2_mcache_master_id,m2_mcache_child_id) +); + +create table m2mcache_set2 ( + m2_mcache_master_id integer not null, + m2_mcache_child_id integer not null, + constraint pk_m2mcache_set2 primary key (m2_mcache_master_id,m2_mcache_child_id) +); + create table maddress ( id uuid not null, street varchar(255), @@ -3230,6 +3274,19 @@ create table e_save_test_c ( constraint pk_e_save_test_c primary key (id) ); +create table parent_a ( + id bigint generated by default as identity not null, + child_id bigint, + name varchar(255), + constraint pk_parent_a primary key (id) +); + +create table parent_b ( + id bigint generated by default as identity not null, + child_id bigint, + constraint pk_parent_b primary key (id) +); + create table parent_person ( identifier integer generated by default as identity not null, name varchar(255), @@ -3361,6 +3418,15 @@ create table person_cache_info ( constraint pk_person_cache_info primary key (person_id) ); +create table persona ( + id bigint generated by default as identity not null, + persona varchar(255), + person_oid bigint, + version integer not null, + constraint uq_persona_person_oid unique (person_oid), + constraint pk_persona primary key (id) +); + create table phones ( id bigint generated by default as identity not null, phone_number varchar(7) not null, @@ -4574,6 +4640,18 @@ alter table la_attr_value_attribute add constraint fk_la_attr_value_attribute_at create index ix_looney_tune_id on looney (tune_id); alter table looney add constraint fk_looney_tune_id foreign key (tune_id) references tune (id) on delete restrict on update restrict; +create index ix_m2mcache_set1_m2_mcache_master on m2mcache_set1 (m2_mcache_master_id); +alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id) on delete restrict on update restrict; + +create index ix_m2mcache_set1_m2_mcache_child on m2mcache_set1 (m2_mcache_child_id); +alter table m2mcache_set1 add constraint fk_m2mcache_set1_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id) on delete restrict on update restrict; + +create index ix_m2mcache_set2_m2_mcache_master on m2mcache_set2 (m2_mcache_master_id); +alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_master foreign key (m2_mcache_master_id) references m2_mcache_master (id) on delete restrict on update restrict; + +create index ix_m2mcache_set2_m2_mcache_child on m2mcache_set2 (m2_mcache_child_id); +alter table m2mcache_set2 add constraint fk_m2mcache_set2_m2_mcache_child foreign key (m2_mcache_child_id) references m2_mcache_child (id) on delete restrict on update restrict; + create index ix_mcontact_customer_id on mcontact (customer_id); alter table mcontact add constraint fk_mcontact_customer_id foreign key (customer_id) references mcustomer (id) on delete restrict on update restrict; @@ -4796,6 +4874,12 @@ alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_paren create index ix_rawinherit_parent_rawinherit_data_rawinherit_data on rawinherit_parent_rawinherit_data (rawinherit_data_id); alter table rawinherit_parent_rawinherit_data add constraint fk_rawinherit_parent_rawinherit_data_rawinherit_data foreign key (rawinherit_data_id) references rawinherit_data (id) on delete restrict on update restrict; +create index ix_parent_a_child_id on parent_a (child_id); +alter table parent_a add constraint fk_parent_a_child_id foreign key (child_id) references child_with_cache (id) on delete restrict on update restrict; + +create index ix_parent_b_child_id on parent_b (child_id); +alter table parent_b add constraint fk_parent_b_child_id foreign key (child_id) references child_with_cache (id) on delete restrict on update restrict; + create index ix_parent_person_some_bean_id on parent_person (some_bean_id); alter table parent_person add constraint fk_parent_person_some_bean_id foreign key (some_bean_id) references e_basic (id) on delete restrict on update restrict; @@ -4829,6 +4913,8 @@ alter table person add constraint fk_person_default_address_oid foreign key (def create index ix_person_cache_email_person_info_person_id on person_cache_email (person_info_person_id); alter table person_cache_email add constraint fk_person_cache_email_person_info_person_id foreign key (person_info_person_id) references person_cache_info (person_id) on delete restrict on update restrict; +alter table persona add constraint fk_persona_person_oid foreign key (person_oid) references person (oid) on delete restrict on update restrict; + create index ix_phones_person_id on phones (person_id); alter table phones add constraint fk_phones_person_id foreign key (person_id) references persons (id) on delete restrict on update restrict; diff --git a/ebean-core/src/test/ddl-review/h2-drop-all.sql b/ebean-core/src/test/ddl-review/h2-drop-all.sql index 16a4f3c7a..52ce28b38 100644 --- a/ebean-core/src/test/ddl-review/h2-drop-all.sql +++ b/ebean-core/src/test/ddl-review/h2-drop-all.sql @@ -1,4 +1,4 @@ --- Generated by ebean unknown at 2020-12-07T09:40:50.461215Z +-- Generated by ebean unknown at 2021-02-12T03:32:14.253435800Z alter table bar drop constraint if exists fk_bar_foo_id; drop index if exists ix_bar_foo_id; @@ -417,6 +417,18 @@ drop index if exists ix_la_attr_value_attribute_attribute; alter table looney drop constraint if exists fk_looney_tune_id; drop index if exists ix_looney_tune_id; +alter table m2mcache_set1 drop constraint if exists fk_m2mcache_set1_m2_mcache_master; +drop index if exists ix_m2mcache_set1_m2_mcache_master; + +alter table m2mcache_set1 drop constraint if exists fk_m2mcache_set1_m2_mcache_child; +drop index if exists ix_m2mcache_set1_m2_mcache_child; + +alter table m2mcache_set2 drop constraint if exists fk_m2mcache_set2_m2_mcache_master; +drop index if exists ix_m2mcache_set2_m2_mcache_master; + +alter table m2mcache_set2 drop constraint if exists fk_m2mcache_set2_m2_mcache_child; +drop index if exists ix_m2mcache_set2_m2_mcache_child; + alter table mcontact drop constraint if exists fk_mcontact_customer_id; drop index if exists ix_mcontact_customer_id; @@ -639,6 +651,12 @@ drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_parent; alter table rawinherit_parent_rawinherit_data drop constraint if exists fk_rawinherit_parent_rawinherit_data_rawinherit_data; drop index if exists ix_rawinherit_parent_rawinherit_data_rawinherit_data; +alter table parent_a drop constraint if exists fk_parent_a_child_id; +drop index if exists ix_parent_a_child_id; + +alter table parent_b drop constraint if exists fk_parent_b_child_id; +drop index if exists ix_parent_b_child_id; + alter table parent_person drop constraint if exists fk_parent_person_some_bean_id; drop index if exists ix_parent_person_some_bean_id; @@ -672,6 +690,8 @@ drop index if exists ix_person_default_address_oid; alter table person_cache_email drop constraint if exists fk_person_cache_email_person_info_person_id; drop index if exists ix_person_cache_email_person_info_person_id; +alter table persona drop constraint if exists fk_persona_person_oid; + alter table phones drop constraint if exists fk_phones_person_id; drop index if exists ix_phones_person_id; @@ -970,6 +990,8 @@ drop table if exists e_save_test_d; drop table if exists child_person; +drop table if exists child_with_cache; + drop table if exists cke_client; drop table if exists cke_user; @@ -1131,6 +1153,8 @@ drop table if exists ebasic_json_node_varchar; drop table if exists ebasic_json_unmapped; +drop table if exists e_basic_log; + drop table if exists e_basic_ndc; drop table if exists ebasic_no_sdchild; @@ -1145,6 +1169,8 @@ drop table if exists e_basic_withlife; drop table if exists e_basic_with_ex; +drop table if exists e_basic_withlog; + drop table if exists e_basicverucon; drop table if exists ecache_child; @@ -1463,6 +1489,14 @@ drop table if exists la_attr_value_attribute; drop table if exists looney; +drop table if exists m2_mcache_child; + +drop table if exists m2_mcache_master; + +drop table if exists m2mcache_set1; + +drop table if exists m2mcache_set2; + drop table if exists maddress; drop table if exists mcontact; @@ -1715,6 +1749,10 @@ drop table if exists rawinherit_parent_rawinherit_data; drop table if exists e_save_test_c; +drop table if exists parent_a; + +drop table if exists parent_b; + drop table if exists parent_person; drop table if exists c_participation; @@ -1745,6 +1783,8 @@ drop table if exists person_cache_email; drop table if exists person_cache_info; +drop table if exists persona; + drop table if exists phones; drop table if exists e_position;