From 77610672a90c3c863e08f542afc7b31dd6bf4000 Mon Sep 17 00:00:00 2001 From: Roland Praml Date: Wed, 14 Jun 2023 18:24:23 +0200 Subject: [PATCH] Regenerated migration scripts again --- .../dbmigration/clickhouse/1.0__initial.sql | 18 ---------- .../dbmigration/clickhouse/1.1.sql | 18 ++++++++++ .../clickhouse/idx_clickhouse.migrations | 4 +-- .../dbmigration/cockroach/1.0__initial.sql | 31 ----------------- .../dbmigration/cockroach/1.1.sql | 31 +++++++++++++++++ .../cockroach/idx_cockroach.migrations | 4 +-- .../dbmigration/db2fori/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/db2fori/1.1.sql | 31 +++++++++++++++++ .../dbmigration/db2fori/idx_db2.migrations | 4 +-- .../dbmigration/db2legacy/1.0__initial.sql | 31 ----------------- .../dbmigration/db2legacy/1.1.sql | 31 +++++++++++++++++ .../db2legacy/idx_generic.migrations | 4 +-- .../dbmigration/db2luw/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/db2luw/1.1.sql | 31 +++++++++++++++++ .../dbmigration/db2luw/idx_db2.migrations | 4 +-- .../dbmigration/db2zos/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/db2zos/1.1.sql | 31 +++++++++++++++++ .../dbmigration/db2zos/idx_db2.migrations | 4 +-- .../dbmigration/generic/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/generic/1.1.sql | 31 +++++++++++++++++ .../generic/idx_generic.migrations | 4 +-- .../dbmigration/h2/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/h2/1.1.sql | 31 +++++++++++++++++ .../dbmigration/h2/idx_h2.migrations | 4 +-- .../dbmigration/hana/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/hana/1.1.sql | 31 +++++++++++++++++ .../dbmigration/hana/idx_hana.migrations | 4 +-- .../dbmigration/hsqldb/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/hsqldb/1.1.sql | 31 +++++++++++++++++ .../dbmigration/hsqldb/idx_hsqldb.migrations | 4 +-- .../mariadb-noprocs/1.0__initial.sql | 31 ----------------- .../dbmigration/mariadb-noprocs/1.1.sql | 31 +++++++++++++++++ .../mariadb-noprocs/idx_mariadb.migrations | 4 +-- .../dbmigration/mariadb/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/mariadb/1.1.sql | 31 +++++++++++++++++ .../mariadb/idx_mariadb.migrations | 4 +-- .../dbmigration/model/1.0__initial.model.xml | 16 --------- .../dbmigration/model/1.1.model.xml | 16 +++++++++ .../dbmigration/mysql/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/mysql/1.1.sql | 31 +++++++++++++++++ .../dbmigration/mysql/idx_mysql.migrations | 4 +-- .../dbmigration/mysql55/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/mysql55/1.1.sql | 31 +++++++++++++++++ .../dbmigration/mysql55/idx_mysql.migrations | 4 +-- .../dbmigration/nuodb/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/nuodb/1.1.sql | 31 +++++++++++++++++ .../dbmigration/nuodb/idx_nuodb.migrations | 4 +-- .../dbmigration/oracle/1.0__initial.sql | 31 ----------------- .../migrationtest/dbmigration/oracle/1.1.sql | 31 +++++++++++++++++ .../dbmigration/oracle/idx_oracle.migrations | 4 +-- .../dbmigration/oracle11/1.0__initial.sql | 34 ------------------- .../dbmigration/oracle11/1.1.sql | 34 +++++++++++++++++++ .../oracle11/idx_oracle.migrations | 4 +-- .../dbmigration/postgres/1.0__initial.sql | 31 ----------------- .../dbmigration/postgres/1.1.sql | 31 +++++++++++++++++ .../postgres/idx_postgres.migrations | 4 +-- .../dbmigration/postgres9/1.0__initial.sql | 31 ----------------- .../dbmigration/postgres9/1.1.sql | 31 +++++++++++++++++ .../postgres9/idx_postgres.migrations | 4 +-- .../dbmigration/sqlanywhere/1.0__initial.sql | 31 ----------------- .../dbmigration/sqlanywhere/1.1.sql | 31 +++++++++++++++++ .../sqlanywhere/idx_sqlanywhere.migrations | 4 +-- .../dbmigration/sqlite/1.0__initial.sql | 25 -------------- .../migrationtest/dbmigration/sqlite/1.1.sql | 25 ++++++++++++++ .../dbmigration/sqlite/idx_sqlite.migrations | 4 +-- .../dbmigration/sqlserver16/1.0__initial.sql | 31 ----------------- .../dbmigration/sqlserver16/1.1.sql | 31 +++++++++++++++++ .../sqlserver16/idx_sqlserver.migrations | 4 +-- .../dbmigration/sqlserver17/1.0__initial.sql | 34 ------------------- .../dbmigration/sqlserver17/1.1.sql | 34 +++++++++++++++++++ .../sqlserver17/idx_sqlserver.migrations | 4 +-- .../dbmigration/yugabyte/1.0__initial.sql | 31 ----------------- .../dbmigration/yugabyte/1.1.sql | 31 +++++++++++++++++ .../yugabyte/idx_yugabyte.migrations | 4 +-- 74 files changed, 795 insertions(+), 795 deletions(-) diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql index 3c8ce6567e..228422449b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql @@ -45,24 +45,6 @@ create table migtest_fk_set_null ( one_id UInt64 ) ENGINE = Log(); -create table drop_main ( - id UInt32 -) ENGINE = Log(); - -create table drop_main_drop_ref_many ( - drop_main_id UInt32, - drop_ref_many_id UInt32 -) ENGINE = Log(); - -create table drop_ref_many ( - id UInt32 -) ENGINE = Log(); - -create table drop_ref_one ( - id UInt32, - parent_id UInt32 -) ENGINE = Log(); - create table migtest_e_basic ( id UInt32, status String, 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 9407dc6402..6effd3ba35 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 @@ -6,6 +6,24 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; -- apply changes +create table drop_main ( + id UInt32 +) ENGINE = Log(); + +create table drop_main_drop_ref_many ( + drop_main_id UInt32, + drop_ref_many_id UInt32 +) ENGINE = Log(); + +create table drop_ref_many ( + id UInt32 +) ENGINE = Log(); + +create table drop_ref_one ( + id UInt32, + parent_id UInt32 +) ENGINE = Log(); + create table migtest_e_test_binary ( id UInt32, test_byte16 String, 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 114a62efdf..f6de06da55 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,5 +1,5 @@ -1672735407, 1.0__initial.sql --1952315279, 1.1.sql +193400547, 1.0__initial.sql +1036221356, 1.1.sql 688811494, 1.2__dropsFor_1.1.sql 1015552567, 1.3.sql -252580551, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql index 79a5c43290..4f47e07743 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -215,15 +193,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 77bda5e71c..a450821e05 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 bytea, @@ -186,6 +208,15 @@ alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest4 unique alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest5 unique (indextest5); alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 5b17c30060..8688ba882e 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,5 +1,5 @@ -1867456246, 1.0__initial.sql --187679618, 1.1.sql +1434934404, 1.0__initial.sql +-1445091875, 1.1.sql 856096334, 1.2__dropsFor_1.1.sql -279468991, 1.3.sql -1398154763, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql index b4660d18ff..9931da4b1d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql index 03a8a49b66..cff474433a 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql @@ -85,6 +85,28 @@ if exists (select indname from syscat.indexes where indschema = current_schema a end if; end$$; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -306,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment'; alter table "table" add versioning use history table table_history; create unique index uq_table_select on "table"("select") exclude null keys; -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/idx_db2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/idx_db2.migrations index bf5b3f0547..e080749fad 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/idx_db2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/idx_db2.migrations @@ -1,5 +1,5 @@ --283216660, 1.0__initial.sql --353204789, 1.1.sql +-1467839063, 1.0__initial.sql +1392865974, 1.1.sql -1187336846, 1.2__dropsFor_1.1.sql -1811865535, 1.3.sql 1864105401, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql index 1490ff0048..7b7bddd1db 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql index 3dc7c46074..08008a18ad 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -189,6 +211,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_generic.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_generic.migrations index ca44cee99c..4adfd909a7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_generic.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_generic.migrations @@ -1,5 +1,5 @@ --528359263, 1.0__initial.sql -308473502, 1.1.sql +-1547037623, 1.0__initial.sql +275373095, 1.1.sql 688811494, 1.2__dropsFor_1.1.sql 674925120, 1.3.sql -252580551, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql index 132b608f75..8b9d60aad6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql index f7d28b6066..be023a9def 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql @@ -85,6 +85,28 @@ if exists (select indname from syscat.indexes where indschema = current_schema a end if; end$$; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -306,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment'; alter table "table" add versioning use history table table_history; create unique index uq_table_select on "table"("select") exclude null keys; -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/idx_db2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/idx_db2.migrations index 51f96139c8..c2926700d6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/idx_db2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/idx_db2.migrations @@ -1,6 +1,6 @@ 1307787475, I__create_tablespaces.sql -1681764655, 1.0__initial.sql --678869146, 1.1.sql +2058232717, 1.0__initial.sql +372361421, 1.1.sql -1187336846, 1.2__dropsFor_1.1.sql 469192394, 1.3.sql 1864105401, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql index 132b608f75..8b9d60aad6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql index f7d28b6066..be023a9def 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql @@ -85,6 +85,28 @@ if exists (select indname from syscat.indexes where indschema = current_schema a end if; end$$; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -306,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment'; alter table "table" add versioning use history table table_history; create unique index uq_table_select on "table"("select") exclude null keys; -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/idx_db2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/idx_db2.migrations index 519d6f4b4f..930929aa3a 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/idx_db2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/idx_db2.migrations @@ -1,5 +1,5 @@ -1681764655, 1.0__initial.sql --678869146, 1.1.sql +2058232717, 1.0__initial.sql +372361421, 1.1.sql -1187336846, 1.2__dropsFor_1.1.sql 469192394, 1.3.sql 1864105401, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql index 1490ff0048..7b7bddd1db 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 3dc7c46074..08008a18ad 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -189,6 +211,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 ca44cee99c..4adfd909a7 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,5 +1,5 @@ --528359263, 1.0__initial.sql -308473502, 1.1.sql +-1547037623, 1.0__initial.sql +275373095, 1.1.sql 688811494, 1.2__dropsFor_1.1.sql 674925120, 1.3.sql -252580551, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql index 93a101a08a..d405e6e70e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -291,15 +269,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 a91bf0fe07..5b15b853f5 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -233,6 +255,15 @@ create view table_with_history as select * from "table" union all select * from create trigger table_history_upd before update,delete on "table" for each row call "io.ebean.platform.h2.H2HistoryTrigger"; alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 588dcf115c..1a613da0d4 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,5 +1,5 @@ -400361768, 1.0__initial.sql -58844973, 1.1.sql +-1854589550, 1.0__initial.sql +-505431855, 1.1.sql 1579867974, 1.2__dropsFor_1.1.sql 64466326, 1.3.sql -232694612, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql index b42347e196..2c41885554 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql @@ -54,28 +54,6 @@ create column table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create column table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create column table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create column table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create column table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create column table migtest_e_basic ( id integer generated by default as identity not null, status nvarchar(1), @@ -297,15 +275,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei -- explicit index "ix_migtest_fk_set_null_one_id" for single column "one_id" of table "migtest_fk_set_null" is not necessary; alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; --- explicit index "ix_drop_main_drop_ref_many_drop_main" for single column "drop_main_id" of table "drop_main_drop_ref_many" is not necessary; -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - --- explicit index "ix_drop_main_drop_ref_many_drop_ref_many" for single column "drop_ref_many_id" of table "drop_main_drop_ref_many" is not necessary; -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - --- explicit index "ix_drop_ref_one_parent_id" for single column "parent_id" of table "drop_ref_one" is not necessary; -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - -- explicit index "ix_migtest_e_basic_eref_id" for single column "eref_id" of table "migtest_e_basic" is not necessary; alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 2a5175f4fe..84800ffc76 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 @@ -59,6 +59,28 @@ exec 'drop index ix_migtest_quoted_status1'; end; $$; -- apply changes +create column table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create column table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create column table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create column table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create column table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -264,6 +286,15 @@ comment on column "table"."index" is 'this is an other comment'; alter table "table" add system versioning history table table_history not validated; -- cannot create unique index "uq_table_select" on table ""table"" with nullable columns; -- foreign keys and indices +-- explicit index "ix_drop_main_drop_ref_many_drop_main" for single column "drop_main_id" of table "drop_main_drop_ref_many" is not necessary; +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +-- explicit index "ix_drop_main_drop_ref_many_drop_ref_many" for single column "drop_ref_many_id" of table "drop_main_drop_ref_many" is not necessary; +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +-- explicit index "ix_drop_ref_one_parent_id" for single column "parent_id" of table "drop_ref_one" is not necessary; +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + -- explicit index "ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c" for single column "migtest_mtm_c_id" of table "migtest_mtm_c_migtest_mtm_m" is not necessary; alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 a859ad5d84..8250815092 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,6 +1,6 @@ -745347271, I__create_procs.sql --1399184401, 1.0__initial.sql --871493688, 1.1.sql +-2017770851, 1.0__initial.sql +2126049978, 1.1.sql 1535221752, 1.2__dropsFor_1.1.sql 1459381570, 1.3.sql -490709749, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql index 90807ee409..ff2f342998 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity (start with 1) not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity (start with 1) not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity (start with 1) not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity (start with 1) not null, status varchar(1), @@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 462cb42e9d..db5e03b994 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer generated by default as identity (start with 1) not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity (start with 1) not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity (start with 1) not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity (start with 1) not null, test_byte16 varbinary(16), @@ -189,6 +211,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 0b9d8c1d1e..f8ca1056cb 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,5 +1,5 @@ -617421105, 1.0__initial.sql --590637714, 1.1.sql +1833930558, 1.0__initial.sql +-432003541, 1.1.sql -848622216, 1.2__dropsFor_1.1.sql -1921508585, 1.3.sql -1547659386, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql index 18c10634b2..f9b1b3f43f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -217,15 +195,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 ac53c38f74..13a754cea6 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 @@ -8,6 +8,28 @@ drop index ix_migtest_e_basic_indextest1 on migtest_e_basic; drop index ix_migtest_e_basic_indextest5 on migtest_e_basic; drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -178,6 +200,15 @@ alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest5 unique alter table migtest_e_history comment = 'We have history now'; alter table `table` add constraint uq_table_select unique (`select`); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 1ea9b536d8..09c4f565f8 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,5 +1,5 @@ --1588268581, 1.0__initial.sql --1543277378, 1.1.sql +-2111548334, 1.0__initial.sql +1717242095, 1.1.sql 919151678, 1.2__dropsFor_1.1.sql -413458006, 1.3.sql -177212756, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql index 18c10634b2..f9b1b3f43f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -217,15 +195,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 ac53c38f74..13a754cea6 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 @@ -8,6 +8,28 @@ drop index ix_migtest_e_basic_indextest1 on migtest_e_basic; drop index ix_migtest_e_basic_indextest5 on migtest_e_basic; drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -178,6 +200,15 @@ alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest5 unique alter table migtest_e_history comment = 'We have history now'; alter table `table` add constraint uq_table_select unique (`select`); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 34f9b6b377..784e32fd0f 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,6 +1,6 @@ -1933396282, I__create_procs.sql --1588268581, 1.0__initial.sql --1543277378, 1.1.sql +-2111548334, 1.0__initial.sql +1717242095, 1.1.sql 1187950993, 1.2__dropsFor_1.1.sql -413458006, 1.3.sql -1494509099, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml index d3b46df240..b0d93151a4 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml @@ -37,22 +37,6 @@ - - - - - - - - - - - - - - - - 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 c59958a6cb..d23d982eed 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 @@ -13,6 +13,22 @@ + + + + + + + + + + + + + + + + diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql index eb95f68166..f2eb08f856 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -345,15 +323,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 258f31c897..2107234400 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 @@ -8,6 +8,28 @@ drop index ix_migtest_e_basic_indextest1 on migtest_e_basic; drop index ix_migtest_e_basic_indextest5 on migtest_e_basic; drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -296,6 +318,15 @@ end$$ unlock tables; alter table `table` add constraint uq_table_select unique (`select`); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 b2fc4d5496..84edad9993 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,6 +1,6 @@ -1933396282, I__create_procs.sql --1156696445, 1.0__initial.sql -1625754872, 1.1.sql +1980830787, 1.0__initial.sql +-847541300, 1.1.sql -1097227916, 1.2__dropsFor_1.1.sql 141196883, 1.3.sql 1044119359, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql index 7e6906ea47..b1db29fc19 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -345,15 +323,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql index 258f31c897..2107234400 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql @@ -8,6 +8,28 @@ drop index ix_migtest_e_basic_indextest1 on migtest_e_basic; drop index ix_migtest_e_basic_indextest5 on migtest_e_basic; drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -296,6 +318,15 @@ end$$ unlock tables; alter table `table` add constraint uq_table_select unique (`select`); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations index 35f9d5e0b9..69f8a03176 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations @@ -1,6 +1,6 @@ -1933396282, I__create_procs.sql --165038024, 1.0__initial.sql -1625754872, 1.1.sql +369577572, 1.0__initial.sql +-847541300, 1.1.sql -1097227916, 1.2__dropsFor_1.1.sql 141196883, 1.3.sql 1044119359, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql index 58cfc41bb1..b5d81c5bd2 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -362,15 +340,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id); -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id); 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 935d3d7d2a..b1e603bc79 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 varbinary(16), @@ -320,6 +342,15 @@ $$ alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); 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 312205fd4d..85b584cd46 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,5 +1,5 @@ --588780599, 1.0__initial.sql --2132614794, 1.1.sql +390216918, 1.0__initial.sql +-303196611, 1.1.sql 1530685455, 1.2__dropsFor_1.1.sql -956168377, 1.3.sql 1047623430, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql index a976889264..4b2f1f9a57 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id number(10) generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id number(10) not null, - drop_ref_many_id number(10) not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id number(10) generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id number(10) generated by default as identity not null, - parent_id number(10), - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id number(10) generated by default as identity not null, status varchar2(1), @@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null; -create index ix_drp_mn_drp_rf_mny_drp_mn on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_drp_mn foreign key (drop_main_id) references drop_main (id); - -create index ix_drp_mn_drp_rf_mny_dr_d70vl on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joeslj foreign key (drop_ref_many_id) references drop_ref_many (id); - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id); 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 5061df2386..c222cc8a51 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 @@ -56,6 +56,28 @@ drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id number(10) generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id number(10) not null, + drop_ref_many_id number(10) not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id number(10) generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id number(10) generated by default as identity not null, + parent_id number(10), + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id number(10) generated by default as identity not null, test_byte16 raw(16), @@ -234,6 +256,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; -- NOT YET IMPLEMENTED: alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drp_mn_drp_rf_mny_drp_mn on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_drp_mn foreign key (drop_main_id) references drop_main (id); + +create index ix_drp_mn_drp_rf_mny_dr_d70vl on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joeslj foreign key (drop_ref_many_id) references drop_ref_many (id); + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); + create index ix_mgtst_mtm_c_mgtst_mt_3ug4ok on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_mgtst_mtm_c_mgtst_mt_93awga foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); 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 83f0e9e91d..7aff21509a 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,5 +1,5 @@ --126940583, 1.0__initial.sql --1646771053, 1.1.sql +1757923548, 1.0__initial.sql +-1862781653, 1.1.sql 930172034, 1.2__dropsFor_1.1.sql -647790612, 1.3.sql -116456403, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql index 3d4518972b..bfbc238c45 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql @@ -62,31 +62,6 @@ create table migtest_fk_set_null ( ); create sequence migtest_fk_set_null_seq; -create table drop_main ( - id number(10) not null, - constraint pk_drop_main primary key (id) -); -create sequence drop_main_seq; - -create table drop_main_drop_ref_many ( - drop_main_id number(10) not null, - drop_ref_many_id number(10) not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id number(10) not null, - constraint pk_drop_ref_many primary key (id) -); -create sequence drop_ref_many_seq; - -create table drop_ref_one ( - id number(10) not null, - parent_id number(10), - constraint pk_drop_ref_one primary key (id) -); -create sequence drop_ref_one_seq; - create table migtest_e_basic ( id number(10) not null, status varchar2(1), @@ -241,15 +216,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null; -create index ix_drp_mn_drp_rf_mny_drp_mn on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_drp_mn foreign key (drop_main_id) references drop_main (id); - -create index ix_drp_mn_drp_rf_mny_dr_d70vl on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joeslj foreign key (drop_ref_many_id) references drop_ref_many (id); - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql index bf0f4278ed..59d29e6499 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql @@ -56,6 +56,31 @@ drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id number(10) not null, + constraint pk_drop_main primary key (id) +); +create sequence drop_main_seq; + +create table drop_main_drop_ref_many ( + drop_main_id number(10) not null, + drop_ref_many_id number(10) not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id number(10) not null, + constraint pk_drop_ref_many primary key (id) +); +create sequence drop_ref_many_seq; + +create table drop_ref_one ( + id number(10) not null, + parent_id number(10), + constraint pk_drop_ref_one primary key (id) +); +create sequence drop_ref_one_seq; + create table migtest_e_test_binary ( id number(10) not null, test_byte16 raw(16), @@ -239,6 +264,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; -- NOT YET IMPLEMENTED: alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drp_mn_drp_rf_mny_drp_mn on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_drp_mn foreign key (drop_main_id) references drop_main (id); + +create index ix_drp_mn_drp_rf_mny_dr_d70vl on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joeslj foreign key (drop_ref_many_id) references drop_ref_many (id); + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); + create index ix_mgtst_mtm_c_mgtst_mt_3ug4ok on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_mgtst_mtm_c_mgtst_mt_93awga foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations index d9f99e4a35..e1d314b8c0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations @@ -1,5 +1,5 @@ -21261569, 1.0__initial.sql --772002701, 1.1.sql +-1422254768, 1.0__initial.sql +661141209, 1.1.sql 930172034, 1.2__dropsFor_1.1.sql 1369863782, 1.3.sql -116456403, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql index eaff8a84d9..acc4504bc8 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, description_file bytea, @@ -374,15 +352,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 d2fa145da9..e116daeced 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 @@ -14,6 +14,28 @@ drop index if exists idxd_migtest_0; drop index concurrently if exists ix_migtest_oto_child_lowername_id; drop index if exists ix_migtest_oto_child_lowername; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 bytea, @@ -391,6 +413,15 @@ create trigger table_history_upd alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 42f2974d3b..b919977c38 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,5 +1,5 @@ --22203872, 1.0__initial.sql --449527326, 1.1.sql +1942370812, 1.0__initial.sql +-150823045, 1.1.sql -261111052, 1.2__dropsFor_1.1.sql 788727457, 1.3.sql -1352224731, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql index af6cf0911c..e91b2b1c3d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id serial not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id serial not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id serial not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id serial not null, description_file bytea, @@ -374,15 +352,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql index 8f131d01ef..dd0d1827c3 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql @@ -14,6 +14,28 @@ drop index if exists idxd_migtest_0; drop index concurrently if exists ix_migtest_oto_child_lowername_id; drop index if exists ix_migtest_oto_child_lowername; -- apply changes +create table drop_main ( + id serial not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id serial not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id serial not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id serial not null, test_byte16 bytea, @@ -391,6 +413,15 @@ create trigger table_history_upd alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations index f75bfffc3b..e2da8048e9 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations @@ -1,5 +1,5 @@ -559327334, 1.0__initial.sql --788518640, 1.1.sql +-1015076364, 1.0__initial.sql +328269371, 1.1.sql -261111052, 1.2__dropsFor_1.1.sql -1811829200, 1.3.sql -1352224731, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql index 9def166785..ee6f3f6a90 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer auto_increment not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer auto_increment not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer auto_increment not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer auto_increment not null, status varchar(1), @@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 13cd0ce15a..3383de4ad0 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer auto_increment not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer auto_increment not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer auto_increment not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer auto_increment not null, test_byte16 varbinary(16), @@ -189,6 +211,15 @@ comment on table migtest_e_history is 'We have history now'; comment on column "table"."index" is 'this is an other comment'; alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 07b9f09320..e5f698839b 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,5 +1,5 @@ -1999303200, 1.0__initial.sql --2053964976, 1.1.sql +-391639901, 1.0__initial.sql +974884972, 1.1.sql 688811494, 1.2__dropsFor_1.1.sql 1199670482, 1.3.sql -252580551, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql index dbb047e574..bfd05a961c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql @@ -56,31 +56,6 @@ create table migtest_fk_set_null ( foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict ); -create table drop_main ( - id integer not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id), - foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict, - foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict -); - -create table drop_ref_many ( - id integer not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id), - foreign key (parent_id) references drop_main (id) on delete restrict on update restrict -); - create table migtest_e_basic ( id integer not null, status varchar(1), 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 7d06abefa5..0560f36e73 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 @@ -11,6 +11,31 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id), + foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict, + foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict +); + +create table drop_ref_many ( + id integer not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id), + foreign key (parent_id) references drop_main (id) on delete restrict on update restrict +); + create table migtest_e_test_binary ( id integer not null, test_byte16 varbinary(16), 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 9b70e29fd3..fe71e16d3c 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,5 +1,5 @@ -238997470, 1.0__initial.sql --456448682, 1.1.sql +-1527127682, 1.0__initial.sql +-321125092, 1.1.sql 688811494, 1.2__dropsFor_1.1.sql 142780650, 1.3.sql -252580551, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql index 52b69c27fe..00b472a4bc 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer identity(1,1) not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer identity(1,1) not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer identity(1,1) not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer identity(1,1) not null, status varchar(1), @@ -246,15 +224,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql index 69366b52c5..11db228e6c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql @@ -13,6 +13,28 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_b IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest5') drop index ix_migtest_e_basic_indextest5 ON migtest_e_basic; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('"migtest_QuOtEd"','U') AND name = 'ix_migtest_quoted_status1') drop index ix_migtest_quoted_status1 ON "migtest_QuOtEd"; -- apply changes +create table drop_main ( + id integer identity(1,1) not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer identity(1,1) not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer identity(1,1) not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer identity(1,1) not null, test_byte16 image, @@ -213,6 +235,15 @@ period for system_time (sys_periodFrom, sys_periodTo); alter table migtest_e_history set (system_versioning = on (history_table=dbo.migtest_e_history_history)); create unique nonclustered index uq_table_select on "table"("select") where "select" is not null; -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations index 7917299b42..c011a69001 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations @@ -1,6 +1,6 @@ 891357544, I__create_procs.sql -254353963, 1.0__initial.sql -262569028, 1.1.sql +-1455820494, 1.0__initial.sql +-88313995, 1.1.sql -1431095657, 1.2__dropsFor_1.1.sql 1846195516, 1.3.sql -225579996, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql index a08c714056..018755be99 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql @@ -62,31 +62,6 @@ create table migtest_fk_set_null ( ); create sequence migtest_fk_set_null_seq as bigint start with 1; -create table drop_main ( - id integer not null, - constraint pk_drop_main primary key (id) -); -create sequence drop_main_seq as bigint start with 1; - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer not null, - constraint pk_drop_ref_many primary key (id) -); -create sequence drop_ref_many_seq as bigint start with 1; - -create table drop_ref_one ( - id integer not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); -create sequence drop_ref_one_seq as bigint start with 1; - create table migtest_e_basic ( id integer not null, status nvarchar(1), @@ -271,15 +246,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql index dc3bb06afb..b79765243d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql @@ -13,6 +13,31 @@ IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_b IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest5') drop index ix_migtest_e_basic_indextest5 ON migtest_e_basic; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('"migtest_QuOtEd"','U') AND name = 'ix_migtest_quoted_status1') drop index ix_migtest_quoted_status1 ON "migtest_QuOtEd"; -- apply changes +create table drop_main ( + id integer not null, + constraint pk_drop_main primary key (id) +); +create sequence drop_main_seq as bigint start with 1; + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer not null, + constraint pk_drop_ref_many primary key (id) +); +create sequence drop_ref_many_seq as bigint start with 1; + +create table drop_ref_one ( + id integer not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); +create sequence drop_ref_one_seq as bigint start with 1; + create table migtest_e_test_binary ( id integer not null, test_byte16 varbinary(16), @@ -218,6 +243,15 @@ period for system_time (sys_periodFrom, sys_periodTo); alter table migtest_e_history set (system_versioning = on (history_table=dbo.migtest_e_history_history)); create unique nonclustered index uq_table_select on "table"("select") where "select" is not null; -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id); + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id); + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id); + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations index 73f6f67d43..e843dc30d7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations @@ -1,6 +1,6 @@ 891357544, I__create_procs.sql -105089711, 1.0__initial.sql -307269467, 1.1.sql +1574627056, 1.0__initial.sql +1681608861, 1.1.sql -1431095657, 1.2__dropsFor_1.1.sql 486442698, 1.3.sql -225579996, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql index 71e9271753..1dbcc0776b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql @@ -54,28 +54,6 @@ create table migtest_fk_set_null ( constraint pk_migtest_fk_set_null primary key (id) ); -create table drop_main ( - id integer generated by default as identity not null, - constraint pk_drop_main primary key (id) -); - -create table drop_main_drop_ref_many ( - drop_main_id integer not null, - drop_ref_many_id integer not null, - constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) -); - -create table drop_ref_many ( - id integer generated by default as identity not null, - constraint pk_drop_ref_many primary key (id) -); - -create table drop_ref_one ( - id integer generated by default as identity not null, - parent_id integer, - constraint pk_drop_ref_one primary key (id) -); - create table migtest_e_basic ( id integer generated by default as identity not null, status varchar(1), @@ -405,15 +383,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id); alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict; -create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; - -create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); -alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; - -create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); -alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; - create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id); alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict; 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 40fe12382f..64478fe819 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 @@ -11,6 +11,28 @@ drop index if exists ix_migtest_e_basic_indextest1; drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_quoted_status1; -- apply changes +create table drop_main ( + id integer generated by default as identity not null, + constraint pk_drop_main primary key (id) +); + +create table drop_main_drop_ref_many ( + drop_main_id integer not null, + drop_ref_many_id integer not null, + constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id) +); + +create table drop_ref_many ( + id integer generated by default as identity not null, + constraint pk_drop_ref_many primary key (id) +); + +create table drop_ref_one ( + id integer generated by default as identity not null, + parent_id integer, + constraint pk_drop_ref_one primary key (id) +); + create table migtest_e_test_binary ( id integer generated by default as identity not null, test_byte16 bytea, @@ -390,6 +412,15 @@ create trigger table_history_upd alter table "table" add constraint uq_table_select unique ("select"); -- foreign keys and indices +create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict; + +create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id); +alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict; + +create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id); +alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict; + create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id); alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict; 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 fbf47fa64a..a5907171d8 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,5 +1,5 @@ -1799266243, 1.0__initial.sql -1695259133, 1.1.sql +-1646972843, 1.0__initial.sql +1912842724, 1.1.sql -261111052, 1.2__dropsFor_1.1.sql -526466104, 1.3.sql -1352224731, 1.4__dropsFor_1.3.sql