diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql index 844845a50..b7d677a4d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql @@ -14,6 +14,11 @@ create table migtest_mtm_m_migtest_mtm_c ( migtest_mtm_c_id UInt32 ) ENGINE = Log(); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id UInt64, + value String +) ENGINE = Log(); + alter table migtest_ckey_detail add column one_key UInt32; alter table migtest_ckey_detail add column two_key String; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql index 24e4e93ba..f45a36211 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql @@ -31,3 +31,4 @@ alter table migtest_oto_child drop column master_id; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations index c2f4378fb..965f25509 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations @@ -1,6 +1,6 @@ 79609527, 1.0__initial.sql --779316787, 1.1.sql +1864520180, 1.1.sql 1359055889, 1.2__dropsFor_1.1.sql -715327671, 1.3.sql --1070218324, 1.4__dropsFor_1.3.sql +-1045594368, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql index f57bbd6d1..8a0ddf08e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -106,6 +111,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql index 9357602a1..985c8764a 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql @@ -36,3 +36,4 @@ drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; drop table if exists migtest_mtm_m_migtest_mtm_c cascade; +drop table if exists migtest_mtm_m_phone_numbers cascade; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations index 549742da7..1d35441b7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations @@ -1,7 +1,7 @@ -487576609, 1.0__initial.sql --889791572, 1.1.sql +-1108404951, 1.1.sql -91524786, 1.2__dropsFor_1.1.sql 735879716, 1.3.sql --807148201, 1.4__dropsFor_1.3.sql +676584941, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.1.sql index 769a12a7b..c56948302 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -40,7 +45,8 @@ alter table migtest_e_basic alter column status2 set data type varchar(127); alter table migtest_e_basic alter column status2 drop default; alter table migtest_e_basic alter column status2 drop not null; --- rename all collisions; +-- db2 does not support parial null indices :( - so we have to clean; +update migtest_e_basic set status = 'N' where id = 1; create unique index uq_migtest_e_basic_description on migtest_e_basic(description) exclude null keys; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; @@ -103,6 +109,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.4__dropsFor_1.3.sql index 038f64f6a..bd6f31169 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/1.4__dropsFor_1.3.sql @@ -32,3 +32,4 @@ drop table migtest_e_user; drop sequence migtest_e_user_seq; drop table migtest_mtm_c_migtest_mtm_m; drop table migtest_mtm_m_migtest_mtm_c; +drop table migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/idx_db2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/idx_db2.migrations index b872100d4..8622a8c4c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2/idx_db2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2/idx_db2.migrations @@ -1,7 +1,7 @@ 1580812656, 1.0__initial.sql -1011854984, 1.1.sql +1615151513, 1.1.sql 578073685, 1.2__dropsFor_1.1.sql -1206650320, 1.3.sql --1475628451, 1.4__dropsFor_1.3.sql +441227910, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql index dbbe731ba..5056799e7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -103,6 +108,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql index 24e4e93ba..f45a36211 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql @@ -31,3 +31,4 @@ alter table migtest_oto_child drop column master_id; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations index dceb0bc58..0855fc2e1 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations @@ -1,6 +1,6 @@ -1827577042, 1.0__initial.sql -350584020, 1.1.sql +-1825206641, 1.1.sql 1359055889, 1.2__dropsFor_1.1.sql 297569863, 1.3.sql --1070218324, 1.4__dropsFor_1.3.sql +-1045594368, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql index b51d15d2e..f639a2e9b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql @@ -23,6 +23,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -114,6 +119,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql index 1776f5309..6574eb2db 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql @@ -46,6 +46,7 @@ drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create view migtest_e_history5_with_history as select * from migtest_e_history5 union all select * from migtest_e_history5_history; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations index 88665985e..c5bafc1f6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations @@ -1,8 +1,8 @@ -745768926, 1.0__initial.sql -39858255, 1.1.sql +1409369419, 1.1.sql 1616986842, 1.2__dropsFor_1.1.sql -1513154593, 1.3.sql -374569329, 1.4__dropsFor_1.3.sql +1549130952, 1.4__dropsFor_1.3.sql 783227075, R__multi_comments.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql index 7f92f6534..0379b11ee 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql @@ -17,6 +17,11 @@ create column table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create column table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value nvarchar(255) not null +); + alter table migtest_ckey_detail add ( one_key integer); alter table migtest_ckey_detail add ( two_key nvarchar(127)); @@ -162,6 +167,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ -- explicit index "ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c" for single column "migtest_mtm_c_id" of table "migtest_mtm_m_migtest_mtm_c" is not necessary; alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +-- explicit index "ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id" for single column "migtest_mtm_m_id" of table "migtest_mtm_m_phone_numbers" is not necessary; +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + -- explicit index "ix_migtest_ckey_parent_assoc_id" for single column "assoc_id" of table "migtest_ckey_parent" is not necessary; alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql index fe5d6371f..526dc7287 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql @@ -49,3 +49,4 @@ CALL usp_ebean_drop_column('migtest_oto_child', 'master_id'); drop table migtest_e_user cascade; drop table migtest_mtm_c_migtest_mtm_m cascade; drop table migtest_mtm_m_migtest_mtm_c cascade; +drop table migtest_mtm_m_phone_numbers cascade; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations index 2f7b6ef51..521c0c0b7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations @@ -1,7 +1,7 @@ -1536923954, 1.0__initial.sql -1039838314, 1.1.sql +-1152055114, 1.1.sql 562867593, 1.2__dropsFor_1.1.sql 1566488731, 1.3.sql -1030652294, 1.4__dropsFor_1.3.sql +201970227, 1.4__dropsFor_1.3.sql 1906063401, R__order_views_hana.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql index cebb8b994..31569c927 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -103,6 +108,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql index c613e4a5a..706cd2892 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql @@ -32,3 +32,4 @@ drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations index 3838db054..c754652e1 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations @@ -1,7 +1,7 @@ 2097980375, 1.0__initial.sql -2086418403, 1.1.sql +-865579750, 1.1.sql -1462014216, 1.2__dropsFor_1.1.sql -2039573992, 1.3.sql -2106151405, 1.4__dropsFor_1.3.sql +-1763496614, 1.4__dropsFor_1.3.sql 861001272, R__order_views_hsqldb.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql index 1d15256d7..04603643f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -60,6 +65,7 @@ alter table migtest_e_history modify test_string bigint; alter table migtest_e_history comment = 'We have history now'; -- NOTE: table has @History - special migration may be necessary +SET @@system_versioning_alter_history = 1; update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 alter test_string set default 'unknown'; alter table migtest_e_history2 modify test_string varchar(255) not null; @@ -96,6 +102,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql index 89603a694..1e2df9b4e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql @@ -32,4 +32,5 @@ drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; alter table migtest_e_history drop system versioning; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations index 68906e201..f862900c1 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations @@ -1,7 +1,7 @@ 1615386118, 1.0__initial.sql -1747697741, 1.1.sql +128637084, 1.1.sql -1462014216, 1.2__dropsFor_1.1.sql -1957738355, 1.3.sql -1081793242, 1.4__dropsFor_1.3.sql +89701608, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql index 1d15256d7..04603643f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -60,6 +65,7 @@ alter table migtest_e_history modify test_string bigint; alter table migtest_e_history comment = 'We have history now'; -- NOTE: table has @History - special migration may be necessary +SET @@system_versioning_alter_history = 1; update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 alter test_string set default 'unknown'; alter table migtest_e_history2 modify test_string varchar(255) not null; @@ -96,6 +102,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql index 1d4e3c6dd..60767659b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql @@ -32,4 +32,5 @@ drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; alter table migtest_e_history drop system versioning; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations index edacb8d17..4ba501e5d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations @@ -1,8 +1,8 @@ 1835064798, I__create_procs.sql 1615386118, 1.0__initial.sql -1747697741, 1.1.sql +128637084, 1.1.sql -116088700, 1.2__dropsFor_1.1.sql -1957738355, 1.3.sql -1065918589, 1.4__dropsFor_1.3.sql +930722740, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml index e165e05d8..7754adc51 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml @@ -16,6 +16,10 @@ + + -- db2 does not support parial null indices :( - so we have to clean + update ${table} set status = 'N' where id = 1 + -- rename all collisions @@ -50,7 +54,15 @@ - + + + SET @@system_versioning_alter_history = 1 + update ${table} set ${column} = 'unknown' where ${column} is null + + + update ${table} set ${column} = 'unknown' where ${column} is null + + @@ -81,6 +93,10 @@ + + + + diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml index 77171547d..296b101b0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml @@ -69,5 +69,6 @@ + \ No newline at end of file diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml index a1cc6616a..19dce6648 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml @@ -19,5 +19,6 @@ + \ No newline at end of file diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql index e3e5bf26a..16d54565f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql @@ -23,6 +23,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -107,6 +112,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql index efa0bbc8a..ff2e34d44 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql @@ -46,6 +46,7 @@ CALL usp_ebean_drop_column('migtest_oto_child', 'master_id'); drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create view migtest_e_history5_with_history as select * from migtest_e_history5 union all select * from migtest_e_history5_history; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations index 2c9e63da4..4ed25ce12 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations @@ -1,8 +1,8 @@ 1835064798, I__create_procs.sql -1087663151, 1.0__initial.sql -880212944, 1.1.sql +-1627573867, 1.1.sql 1922991807, 1.2__dropsFor_1.1.sql -380371830, 1.3.sql --1139228843, 1.4__dropsFor_1.3.sql +-1373040825, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql index a294d7106..503833010 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql @@ -23,6 +23,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -112,6 +117,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id); + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql index ea4a15720..d7e3eaf34 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql @@ -47,6 +47,7 @@ drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create view migtest_e_history5_with_history as select * from migtest_e_history5 union all select * from migtest_e_history5_history; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations index e9f64b6a8..a16275206 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations @@ -1,7 +1,7 @@ -600390912, 1.0__initial.sql -85177147, 1.1.sql +667708916, 1.1.sql -1171866240, 1.2__dropsFor_1.1.sql 870952105, 1.3.sql -560246183, 1.4__dropsFor_1.3.sql +473283202, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql index d3a951da4..b6de2b755 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql @@ -18,6 +18,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id number(19) not null, + value varchar2(255) not null +); + alter table migtest_ckey_detail add one_key number(10); alter table migtest_ckey_detail add two_key varchar2(127); @@ -104,6 +109,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_mgtst_mtm_m_mgtst_mt_g create index ix_mgtst_mtm_m_mgtst_mt_b7nbck on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_mgtst_mtm_m_mgtst_mt_ggi34a foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); +create index ix_mgtst_mtm_m_phn_nmbr_do9ma3 on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_mgtst_mtm_m_phn_nmbr_s8neid foreign key (migtest_mtm_m_id) references migtest_mtm_m (id); + create index ix_mgtst_cky_prnt_ssc_d on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_mgtst_cky_prnt_ssc_d foreign key (assoc_id) references migtest_ckey_assoc (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql index 52c81411a..34fe0bed4 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql @@ -32,3 +32,4 @@ drop table migtest_e_user cascade constraints purge; drop sequence migtest_e_user_seq; drop table migtest_mtm_c_migtest_mtm_m cascade constraints purge; drop table migtest_mtm_m_migtest_mtm_c cascade constraints purge; +drop table migtest_mtm_m_phone_numbers cascade constraints purge; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations index 5612d75f3..0d92c64be 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations @@ -1,8 +1,8 @@ 1839897438, 1.0__initial.sql -1699280801, 1.1.sql +1927010726, 1.1.sql 238598298, 1.2__dropsFor_1.1.sql 1543053715, 1.3.sql -1213528478, 1.4__dropsFor_1.3.sql +-629809805, 1.4__dropsFor_1.3.sql 1357801733, R__oracle_only_views.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql index 5a3df8b8f..82fc83f2b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql @@ -23,6 +23,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -120,6 +125,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql index 748ee959b..4524d4a40 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql @@ -47,6 +47,7 @@ drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; drop table if exists migtest_mtm_m_migtest_mtm_c cascade; +drop table if exists migtest_mtm_m_phone_numbers cascade; create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create view migtest_e_history5_with_history as select * from migtest_e_history5 union all select * from migtest_e_history5_history; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations index 847f2ddca..370c64f13 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations @@ -1,8 +1,8 @@ 1428934272, 1.0__initial.sql --1309302980, 1.1.sql +1253246780, 1.1.sql -1861367028, 1.2__dropsFor_1.1.sql 326342179, 1.3.sql -1959776888, 1.4__dropsFor_1.3.sql +-1991941691, 1.4__dropsFor_1.3.sql 783227075, R__multi_comments.sql 561281075, R__order_views.sql 283077354, R__pg_indexes.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql index ba632c339..957136815 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql @@ -17,6 +17,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id numeric(19) not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -103,6 +108,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql index 24e4e93ba..f45a36211 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql @@ -31,3 +31,4 @@ alter table migtest_oto_child drop column master_id; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations index 7573b93ff..684ce1c07 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations @@ -1,6 +1,6 @@ 471098770, 1.0__initial.sql --1404654186, 1.1.sql +776493598, 1.1.sql 1359055889, 1.2__dropsFor_1.1.sql -1656705954, 1.3.sql --1070218324, 1.4__dropsFor_1.3.sql +-1045594368, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql index a762b673e..888db9989 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql @@ -21,6 +21,12 @@ create table migtest_mtm_m_migtest_mtm_c ( foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id integer not null, + value varchar(255) not null, + foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql index 24e4e93ba..f45a36211 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql @@ -31,3 +31,4 @@ alter table migtest_oto_child drop column master_id; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; +drop table if exists migtest_mtm_m_phone_numbers; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations index 8dc515327..25e367a67 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations @@ -1,7 +1,7 @@ 1429491518, 1.0__initial.sql --347121868, 1.1.sql +-1974335860, 1.1.sql 1359055889, 1.2__dropsFor_1.1.sql -1764531063, 1.3.sql --1070218324, 1.4__dropsFor_1.3.sql +-1045594368, 1.4__dropsFor_1.3.sql 2034589659, R__order_views_sqlite.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.1.sql index f8ba67fe0..9090ca711 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.1.sql @@ -18,6 +18,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id numeric(19) not null, + value nvarchar(255) not null +); + alter table migtest_ckey_detail add one_key integer; alter table migtest_ckey_detail add two_key nvarchar(127); @@ -103,6 +108,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id); + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.4__dropsFor_1.3.sql index 4cc7ad30b..3f465ec78 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/1.4__dropsFor_1.3.sql @@ -32,6 +32,7 @@ IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user; IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq; IF OBJECT_ID('migtest_mtm_c_migtest_mtm_m', 'U') IS NOT NULL drop table migtest_mtm_c_migtest_mtm_m; IF OBJECT_ID('migtest_mtm_m_migtest_mtm_c', 'U') IS NOT NULL drop table migtest_mtm_m_migtest_mtm_c; +IF OBJECT_ID('migtest_mtm_m_phone_numbers', 'U') IS NOT NULL drop table migtest_mtm_m_phone_numbers; -- dropping history support for migtest_e_history; EXEC usp_ebean_drop_default_constraint migtest_e_history, sys_periodFrom; EXEC usp_ebean_drop_default_constraint migtest_e_history, sys_periodTo; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/idx_sqlserver.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/idx_sqlserver.migrations index f78f12855..388adffc2 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/idx_sqlserver.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver/idx_sqlserver.migrations @@ -1,8 +1,8 @@ -2122378240, I__create_procs.sql -1048913407, 1.0__initial.sql -615613536, 1.1.sql +-898063858, 1.1.sql -1805601919, 1.2__dropsFor_1.1.sql -1791137342, 1.3.sql -460536923, 1.4__dropsFor_1.3.sql +-1335541264, 1.4__dropsFor_1.3.sql 1607822082, R__order_views_mssql.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql index e4698ca62..7a911b54c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql @@ -23,6 +23,11 @@ create table migtest_mtm_m_migtest_mtm_c ( constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id) ); +create table migtest_mtm_m_phone_numbers ( + migtest_mtm_m_id bigint not null, + value varchar(255) not null +); + alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); @@ -114,6 +119,9 @@ alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_ create index ix_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c on migtest_mtm_m_migtest_mtm_c (migtest_mtm_c_id); alter table migtest_mtm_m_migtest_mtm_c add constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; +create index ix_migtest_mtm_m_phone_numbers_migtest_mtm_m_id on migtest_mtm_m_phone_numbers (migtest_mtm_m_id); +alter table migtest_mtm_m_phone_numbers add constraint fk_migtest_mtm_m_phone_numbers_migtest_mtm_m_id foreign key (migtest_mtm_m_id) references migtest_mtm_m (id) on delete restrict on update restrict; + create index ix_migtest_ckey_parent_assoc_id on migtest_ckey_parent (assoc_id); alter table migtest_ckey_parent add constraint fk_migtest_ckey_parent_assoc_id foreign key (assoc_id) references migtest_ckey_assoc (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql index 748ee959b..4524d4a40 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql @@ -47,6 +47,7 @@ drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; drop table if exists migtest_mtm_m_migtest_mtm_c cascade; +drop table if exists migtest_mtm_m_phone_numbers cascade; create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create view migtest_e_history5_with_history as select * from migtest_e_history5 union all select * from migtest_e_history5_history; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations index c1d90b411..4dd2bc71e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations @@ -1,7 +1,7 @@ -1449071956, 1.0__initial.sql -1483502951, 1.1.sql +1985413053, 1.1.sql -1861367028, 1.2__dropsFor_1.1.sql 2034977550, 1.3.sql -1959776888, 1.4__dropsFor_1.3.sql +-1991941691, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql