diff --git a/ebean-test/src/test/java/io/ebean/xtest/dbmigration/DbMigrationTest.java b/ebean-test/src/test/java/io/ebean/xtest/dbmigration/DbMigrationTest.java index 9a3cff37c5..50a66e6d3b 100644 --- a/ebean-test/src/test/java/io/ebean/xtest/dbmigration/DbMigrationTest.java +++ b/ebean-test/src/test/java/io/ebean/xtest/dbmigration/DbMigrationTest.java @@ -83,9 +83,14 @@ public void testRunMigration() throws IOException, SQLException { "`migtest_QuOtEd`", "migtest_QuOtEd", "\"migtest_QuOtEd\"", + "drop_main_drop_ref_many", + "drop_ref_many", + "drop_ref_one", + "drop_main", "table", "\"table\"", "`table`"); + ((DataSourcePool)server().dataSource()).offline(); ((DataSourcePool)server().dataSource()).online(); diff --git a/ebean-test/src/test/java/misc/migration/NOTICE.md b/ebean-test/src/test/java/misc/migration/NOTICE.md new file mode 100644 index 0000000000..33b1db5e8d --- /dev/null +++ b/ebean-test/src/test/java/misc/migration/NOTICE.md @@ -0,0 +1,10 @@ +The migration dir contains 3 folders `v1_0`, `v1_1`, `v1_2`. + +The general idea is, that we try to perform a migration (=`v1.0` -> `v1.1`) and also if it is revertable (= `v1.1` -> `v1.0`) + +To achieve that, the directories `v1_0` and `v1_2` should be as equal as possible. Annomalies should be commented. + +It is also important, if new models are added, that all table names (also for M2M) are added in the `DbMigrationTest` +cleanup routine. + + diff --git a/ebean-test/src/test/java/misc/migration/v1_0/DropMain.java b/ebean-test/src/test/java/misc/migration/v1_1/DropMain.java similarity index 97% rename from ebean-test/src/test/java/misc/migration/v1_0/DropMain.java rename to ebean-test/src/test/java/misc/migration/v1_1/DropMain.java index da7e6a2505..c8189773a2 100644 --- a/ebean-test/src/test/java/misc/migration/v1_0/DropMain.java +++ b/ebean-test/src/test/java/misc/migration/v1_1/DropMain.java @@ -1,4 +1,4 @@ -package misc.migration.v1_0; +package misc.migration.v1_1; import javax.persistence.*; import java.util.List; diff --git a/ebean-test/src/test/java/misc/migration/v1_0/DropRefMany.java b/ebean-test/src/test/java/misc/migration/v1_1/DropRefMany.java similarity index 89% rename from ebean-test/src/test/java/misc/migration/v1_0/DropRefMany.java rename to ebean-test/src/test/java/misc/migration/v1_1/DropRefMany.java index a3727d5c21..76b8a2b428 100644 --- a/ebean-test/src/test/java/misc/migration/v1_0/DropRefMany.java +++ b/ebean-test/src/test/java/misc/migration/v1_1/DropRefMany.java @@ -1,9 +1,8 @@ -package misc.migration.v1_0; +package misc.migration.v1_1; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; import javax.persistence.Table; import java.util.List; diff --git a/ebean-test/src/test/java/misc/migration/v1_0/DropRefOne.java b/ebean-test/src/test/java/misc/migration/v1_1/DropRefOne.java similarity index 94% rename from ebean-test/src/test/java/misc/migration/v1_0/DropRefOne.java rename to ebean-test/src/test/java/misc/migration/v1_1/DropRefOne.java index 069b9274db..3de28d1ac0 100644 --- a/ebean-test/src/test/java/misc/migration/v1_0/DropRefOne.java +++ b/ebean-test/src/test/java/misc/migration/v1_1/DropRefOne.java @@ -1,4 +1,4 @@ -package misc.migration.v1_0; +package misc.migration.v1_1; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/ebean-test/src/test/java/misc/migration/v1_2/EBasic.java b/ebean-test/src/test/java/misc/migration/v1_2/EBasic.java index 75246ce3e0..191dc52151 100644 --- a/ebean-test/src/test/java/misc/migration/v1_2/EBasic.java +++ b/ebean-test/src/test/java/misc/migration/v1_2/EBasic.java @@ -11,6 +11,10 @@ @Entity @Table(name = "migtest_e_basic") +// Note: tablespaces are currently only supported for DB2 +// to be prepared for future (when we support sql server filegroups), +// we allow to specify the DB-platform here +@Tablespace(value = "db2;TSTABLES;", index = "db2;INDEXTS;") public class EBasic { public enum Status { @@ -86,7 +90,7 @@ public enum Status { String indextest6; @NotNull - @DbDefault("23") + @DbDefault("23") // required for revert int user_id; public EBasic() { diff --git a/ebean-test/src/test/java/misc/migration/v1_2/EHistory6.java b/ebean-test/src/test/java/misc/migration/v1_2/EHistory6.java index 7c321b580f..284b706b85 100644 --- a/ebean-test/src/test/java/misc/migration/v1_2/EHistory6.java +++ b/ebean-test/src/test/java/misc/migration/v1_2/EHistory6.java @@ -21,6 +21,6 @@ public class EHistory6 { Integer testNumber1; @NotNull - @DbDefault("7") + @DbDefault("7") // required for revert Integer testNumber2; } diff --git a/ebean-test/src/test/java/misc/migration/v1_2/ETable.java b/ebean-test/src/test/java/misc/migration/v1_2/ETable.java index 6192e7f715..edfe5b3091 100644 --- a/ebean-test/src/test/java/misc/migration/v1_2/ETable.java +++ b/ebean-test/src/test/java/misc/migration/v1_2/ETable.java @@ -45,4 +45,13 @@ public class ETable { @OneToMany(mappedBy = "foreign") List foreigns; + + // @NotNull + // @DbDefault("") + // private String textfield; + // FIXME: MariaDb produces an invalid quoted statement. We would need to fix quotes here. + // but using reserved names for tables is a bad idea IMHO + // actual: update "table" set textfield = '' where textfield is null; + // expected: update `table` set textfield = '' where textfield is null; + } diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql index 5934a713ad..cb6860e639 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql @@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql index b7d11cb4df..52fd62211c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.4__dropsFor_1.3.sql @@ -17,6 +17,10 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 b1ff6021b6..a38537136b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations @@ -1,6 +1,6 @@ 1672735407, 1.0__initial.sql 540706946, 1.1.sql --875723380, 1.2__dropsFor_1.1.sql +688811494, 1.2__dropsFor_1.1.sql 1015552567, 1.3.sql -255653518, 1.4__dropsFor_1.3.sql +677297367, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql index c245c07b92..183dcdc714 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 drop index uq_migtest_e_basic_indextest2 cascade; drop index uq_migtest_e_basic_indextest6 cascade; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql index 5fc81acf1c..44f13ac120 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql @@ -7,13 +7,6 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main cascade; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many cascade; -drop table if exists drop_ref_many cascade; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one cascade; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd" cascade; drop table if exists migtest_e_ref cascade; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql index 67ff8ef72b..82f045e289 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql @@ -14,6 +14,9 @@ drop index uq_migtest_e_basic_name cascade; drop index uq_migtest_e_basic_indextest4 cascade; drop index uq_migtest_e_basic_indextest5 cascade; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table if exists migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql index a643969f84..27c0b1b7fb 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.4__dropsFor_1.3.sql @@ -17,6 +17,13 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main cascade; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many cascade; +drop table if exists drop_ref_many cascade; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one cascade; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; 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 f3e4ced0c5..3a59a4520e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations @@ -1,7 +1,7 @@ 1867456246, 1.0__initial.sql --412570267, 1.1.sql -395394572, 1.2__dropsFor_1.1.sql --861259583, 1.3.sql --971909974, 1.4__dropsFor_1.3.sql +1284257915, 1.1.sql +856096334, 1.2__dropsFor_1.1.sql +-279468991, 1.3.sql +2137365848, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql 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 dbc55894f4..3032d43532 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 @@ -65,27 +65,6 @@ end if; end$$; delimiter $$ begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then - prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; - execute stmt; -end if; -end$$; -delimiter $$ -begin if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then prepare stmt from 'drop index ix_migtest_e_basic_indextest1'; execute stmt; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql index f671f86d2a..28b8850d6f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql @@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2; call sysproc.admin_cmd('reorg table migtest_e_history2_history'); -- apply post alter alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; -drop table drop_main; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then - prepare stmt from 'drop sequence drop_main_seq'; - execute stmt; -end if; -end$$; -drop table drop_main_drop_ref_many; -drop table drop_ref_many; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then - prepare stmt from 'drop sequence drop_ref_many_seq'; - execute stmt; -end if; -end$$; -drop table drop_ref_one; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then - prepare stmt from 'drop sequence drop_ref_one_seq'; - execute stmt; -end if; -end$$; drop table "migtest_QuOtEd"; drop table migtest_e_ref; delimiter $$ diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql index 9864c4f79e..f0aa6f28c7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql @@ -135,6 +135,27 @@ end if; end$$; delimiter $$ begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then + prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; + execute stmt; +end if; +end$$; +delimiter $$ +begin if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c'; execute stmt; @@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set a_lob = 'X' where a_lob is null; update migtest_e_basic set user_id = 23 where user_id is null; +CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE'); alter table migtest_e_history2 drop versioning; alter table migtest_e_history3 drop versioning; alter table migtest_e_history4 drop versioning; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql index ecc7c99fa0..c2a60415ab 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql @@ -48,6 +48,31 @@ drop table migtest_e_history_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history5 add versioning use history table migtest_e_history5_history; alter table "table" add versioning use history table table_history; +drop table drop_main; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then + prepare stmt from 'drop sequence drop_main_seq'; + execute stmt; +end if; +end$$; +drop table drop_main_drop_ref_many; +drop table drop_ref_many; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then + prepare stmt from 'drop sequence drop_ref_many_seq'; + execute stmt; +end if; +end$$; +drop table drop_ref_one; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then + prepare stmt from 'drop sequence drop_ref_one_seq'; + execute stmt; +end if; +end$$; drop table migtest_e_user; delimiter $$ begin 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 786fdf1ff4..d305cb8ef6 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,7 +1,7 @@ -283216660, 1.0__initial.sql -1120848440, 1.1.sql -135256939, 1.2__dropsFor_1.1.sql --2139056187, 1.3.sql -946163478, 1.4__dropsFor_1.3.sql +-184000413, 1.1.sql +-1187336846, 1.2__dropsFor_1.1.sql +-1811865535, 1.3.sql +-1255430844, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql 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 cb3cb88adb..645d357f21 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql index 5934a713ad..cb6860e639 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql @@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql index 63f9580db8..143b82f5c3 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql index b7d11cb4df..52fd62211c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql @@ -17,6 +17,10 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 74218a1a64..7b2bfb7888 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,6 +1,6 @@ -528359263, 1.0__initial.sql --1374084944, 1.1.sql --875723380, 1.2__dropsFor_1.1.sql --819139044, 1.3.sql -255653518, 1.4__dropsFor_1.3.sql +253988246, 1.1.sql +688811494, 1.2__dropsFor_1.1.sql +674925120, 1.3.sql +677297367, 1.4__dropsFor_1.3.sql 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 ab12314e57..2f4beedaaf 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 @@ -65,27 +65,6 @@ end if; end$$; delimiter $$ begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then - prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; - execute stmt; -end if; -end$$; -delimiter $$ -begin if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then prepare stmt from 'drop index ix_migtest_e_basic_indextest1'; execute stmt; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql index f671f86d2a..28b8850d6f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql @@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2; call sysproc.admin_cmd('reorg table migtest_e_history2_history'); -- apply post alter alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; -drop table drop_main; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then - prepare stmt from 'drop sequence drop_main_seq'; - execute stmt; -end if; -end$$; -drop table drop_main_drop_ref_many; -drop table drop_ref_many; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then - prepare stmt from 'drop sequence drop_ref_many_seq'; - execute stmt; -end if; -end$$; -drop table drop_ref_one; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then - prepare stmt from 'drop sequence drop_ref_one_seq'; - execute stmt; -end if; -end$$; drop table "migtest_QuOtEd"; drop table migtest_e_ref; delimiter $$ diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql index f9e79df783..d86bd5d342 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql @@ -135,6 +135,27 @@ end if; end$$; delimiter $$ begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then + prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; + execute stmt; +end if; +end$$; +delimiter $$ +begin if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c'; execute stmt; @@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set a_lob = 'X' where a_lob is null; update migtest_e_basic set user_id = 23 where user_id is null; +CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE'); alter table migtest_e_history2 drop versioning; alter table migtest_e_history3 drop versioning; alter table migtest_e_history4 drop versioning; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql index ecc7c99fa0..c2a60415ab 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql @@ -48,6 +48,31 @@ drop table migtest_e_history_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history5 add versioning use history table migtest_e_history5_history; alter table "table" add versioning use history table table_history; +drop table drop_main; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then + prepare stmt from 'drop sequence drop_main_seq'; + execute stmt; +end if; +end$$; +drop table drop_main_drop_ref_many; +drop table drop_ref_many; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then + prepare stmt from 'drop sequence drop_ref_many_seq'; + execute stmt; +end if; +end$$; +drop table drop_ref_one; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then + prepare stmt from 'drop sequence drop_ref_one_seq'; + execute stmt; +end if; +end$$; drop table migtest_e_user; delimiter $$ begin 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 195e14753d..769c506f28 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,8 +1,8 @@ 1307787475, I__create_tablespaces.sql 1681764655, 1.0__initial.sql -1259437403, 1.1.sql -135256939, 1.2__dropsFor_1.1.sql -1091218936, 1.3.sql -946163478, 1.4__dropsFor_1.3.sql +-1450326352, 1.1.sql +-1187336846, 1.2__dropsFor_1.1.sql +469192394, 1.3.sql +-1255430844, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql 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 ab12314e57..2f4beedaaf 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 @@ -65,27 +65,6 @@ end if; end$$; delimiter $$ begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then - prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; - execute stmt; -end if; -end$$; -delimiter $$ -begin -if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then - prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; - execute stmt; -end if; -end$$; -delimiter $$ -begin if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then prepare stmt from 'drop index ix_migtest_e_basic_indextest1'; execute stmt; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql index f671f86d2a..28b8850d6f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql @@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2; call sysproc.admin_cmd('reorg table migtest_e_history2_history'); -- apply post alter alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; -drop table drop_main; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then - prepare stmt from 'drop sequence drop_main_seq'; - execute stmt; -end if; -end$$; -drop table drop_main_drop_ref_many; -drop table drop_ref_many; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then - prepare stmt from 'drop sequence drop_ref_many_seq'; - execute stmt; -end if; -end$$; -drop table drop_ref_one; -delimiter $$ -begin -if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then - prepare stmt from 'drop sequence drop_ref_one_seq'; - execute stmt; -end if; -end$$; drop table "migtest_QuOtEd"; drop table migtest_e_ref; delimiter $$ diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql index f9e79df783..d86bd5d342 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql @@ -135,6 +135,27 @@ end if; end$$; delimiter $$ begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then + prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many'; + execute stmt; +end if; +end$$; +delimiter $$ +begin +if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then + prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id'; + execute stmt; +end if; +end$$; +delimiter $$ +begin if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c'; execute stmt; @@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set a_lob = 'X' where a_lob is null; update migtest_e_basic set user_id = 23 where user_id is null; +CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE'); alter table migtest_e_history2 drop versioning; alter table migtest_e_history3 drop versioning; alter table migtest_e_history4 drop versioning; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql index ecc7c99fa0..c2a60415ab 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql @@ -48,6 +48,31 @@ drop table migtest_e_history_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history5 add versioning use history table migtest_e_history5_history; alter table "table" add versioning use history table table_history; +drop table drop_main; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then + prepare stmt from 'drop sequence drop_main_seq'; + execute stmt; +end if; +end$$; +drop table drop_main_drop_ref_many; +drop table drop_ref_many; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then + prepare stmt from 'drop sequence drop_ref_many_seq'; + execute stmt; +end if; +end$$; +drop table drop_ref_one; +delimiter $$ +begin +if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then + prepare stmt from 'drop sequence drop_ref_one_seq'; + execute stmt; +end if; +end$$; drop table migtest_e_user; delimiter $$ begin 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 618846ffec..5a08e6b7c6 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,7 +1,7 @@ 1681764655, 1.0__initial.sql -1259437403, 1.1.sql -135256939, 1.2__dropsFor_1.1.sql -1091218936, 1.3.sql -946163478, 1.4__dropsFor_1.3.sql +-1450326352, 1.1.sql +-1187336846, 1.2__dropsFor_1.1.sql +469192394, 1.3.sql +-1255430844, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql index cb3cb88adb..645d357f21 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql index 5934a713ad..cb6860e639 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql @@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql index 63f9580db8..143b82f5c3 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql index b7d11cb4df..52fd62211c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.4__dropsFor_1.3.sql @@ -17,6 +17,10 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 74218a1a64..7b2bfb7888 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations @@ -1,6 +1,6 @@ -528359263, 1.0__initial.sql --1374084944, 1.1.sql --875723380, 1.2__dropsFor_1.1.sql --819139044, 1.3.sql -255653518, 1.4__dropsFor_1.3.sql +253988246, 1.1.sql +688811494, 1.2__dropsFor_1.1.sql +674925120, 1.3.sql +677297367, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql index afb910c0b1..93ae665e68 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql index d270bde5ea..a0c8ec44ba 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql @@ -14,13 +14,6 @@ alter table migtest_e_history2_history drop column obsolete_string2; -- apply post alter create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history; create trigger migtest_e_history2_history_upd before update,delete on migtest_e_history2 for each row call "io.ebean.platform.h2.H2HistoryTrigger"; -drop table if exists drop_main; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql index 14d847530e..b6985ab02b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql index e7863869ab..475ab0a4c8 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.4__dropsFor_1.3.sql @@ -43,6 +43,13 @@ create view migtest_e_history5_with_history as select * from migtest_e_history5 create trigger migtest_e_history5_history_upd before update,delete on migtest_e_history5 for each row call "io.ebean.platform.h2.H2HistoryTrigger"; create view table_with_history as select * from "table" union all select * from table_history; create trigger table_history_upd before update,delete on "table" for each row call "io.ebean.platform.h2.H2HistoryTrigger"; +drop table if exists drop_main; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 ad8f05cb22..6f155dc9a9 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations @@ -1,8 +1,8 @@ 400361768, 1.0__initial.sql -1531147865, 1.1.sql -2123154375, 1.2__dropsFor_1.1.sql -363782261, 1.3.sql --1120611041, 1.4__dropsFor_1.3.sql +1979519453, 1.1.sql +1579867974, 1.2__dropsFor_1.1.sql +64466326, 1.3.sql +255910011, 1.4__dropsFor_1.3.sql 783227075, R__multi_comments.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql index fe2af578a5..98d8266857 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 @@ -37,9 +37,6 @@ declare exit handler for sql_error_code 397 begin end; exec 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status'; end; $$; -alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; delimiter $$ do begin diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql index 6fcca7c676..b5fe0f04f2 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql @@ -12,9 +12,5 @@ CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string1'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2'); -- apply post alter alter table migtest_e_history2 add system versioning history table migtest_e_history2_history not validated; -drop table drop_main cascade; -drop table drop_main_drop_ref_many cascade; -drop table drop_ref_many cascade; -drop table drop_ref_one cascade; drop table "migtest_QuOtEd" cascade; drop table migtest_e_ref cascade; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql index a06064e3d8..5db0b96201 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql @@ -62,6 +62,9 @@ declare exit handler for sql_error_code 397 begin end; exec 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status'; end; $$; +alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql index 801ddd022d..caee68f0e0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.4__dropsFor_1.3.sql @@ -35,6 +35,10 @@ CALL usp_ebean_drop_column('table_history', 'textfield2'); alter table migtest_e_history2 add system versioning history table migtest_e_history2_history not validated; alter table migtest_e_history5 add system versioning history table migtest_e_history5_history not validated; alter table "table" add system versioning history table table_history not validated; +drop table drop_main cascade; +drop table drop_main_drop_ref_many cascade; +drop table drop_ref_many cascade; +drop table drop_ref_one cascade; drop table migtest_e_user cascade; drop table migtest_mtm_c_migtest_mtm_m cascade; drop table migtest_mtm_m_migtest_mtm_c cascade; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations index 935bc4cf2d..fe3245fb3a 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,8 +1,8 @@ -745347271, I__create_procs.sql -1399184401, 1.0__initial.sql --1126493787, 1.1.sql --1209748806, 1.2__dropsFor_1.1.sql --657475021, 1.3.sql -1185007986, 1.4__dropsFor_1.3.sql +-1727762906, 1.1.sql +1535221752, 1.2__dropsFor_1.1.sql +1459381570, 1.3.sql +1163601680, 1.4__dropsFor_1.3.sql 1906063401, R__order_views_hana.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql index 4f53eb7cdb..94010fa00b 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql index 25d0b60d87..eeb8a6a1cd 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql @@ -7,13 +7,6 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql index 523838fb0a..6e67d63b2c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql index 9387dec426..b47c0901d8 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.4__dropsFor_1.3.sql @@ -17,6 +17,13 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 8c976d04a0..389d2fb131 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations @@ -1,7 +1,7 @@ 617421105, 1.0__initial.sql --271408671, 1.1.sql -1366518530, 1.2__dropsFor_1.1.sql -1536842100, 1.3.sql -1661935263, 1.4__dropsFor_1.3.sql +84224587, 1.1.sql +-848622216, 1.2__dropsFor_1.1.sql +-1921508585, 1.3.sql +1870787524, 1.4__dropsFor_1.3.sql 861001272, R__order_views_hsqldb.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql index 25b6f28361..4213de18ea 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 @@ -4,9 +4,6 @@ alter table migtest_fk_cascade drop foreign key fk_migtest_fk_cascade_one_id; alter table migtest_fk_set_null drop foreign key fk_migtest_fk_set_null_one_id; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; 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`; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql index 11a53de7f5..60699805e5 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql @@ -9,13 +9,6 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one; -drop sequence if exists drop_ref_one_seq; drop table if exists `migtest_QuOtEd`; drop table if exists migtest_e_ref; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql index cdf8b7589c..388434adc1 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql @@ -11,6 +11,9 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_status_indextest1; alter table migtest_e_basic drop index uq_migtest_e_basic_name; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop foreign key fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql index 2f4425f31a..4fecc1a2c2 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.4__dropsFor_1.3.sql @@ -20,6 +20,13 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 8bbc74d7c8..f64c4144b2 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations @@ -1,7 +1,7 @@ -1588268581, 1.0__initial.sql -993683171, 1.1.sql --799907262, 1.2__dropsFor_1.1.sql --797191406, 1.3.sql -1686135364, 1.4__dropsFor_1.3.sql +-1101751768, 1.1.sql +919151678, 1.2__dropsFor_1.1.sql +-413458006, 1.3.sql +-1557805741, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql index 25b6f28361..4213de18ea 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 @@ -4,9 +4,6 @@ alter table migtest_fk_cascade drop foreign key fk_migtest_fk_cascade_one_id; alter table migtest_fk_set_null drop foreign key fk_migtest_fk_set_null_one_id; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; 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`; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql index 7ee0a40234..8d64a08042 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql @@ -9,13 +9,6 @@ CALL usp_ebean_drop_column('migtest_e_basic', 'eref_id'); CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string1'); CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2'); -- apply post alter -drop table if exists drop_main; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one; -drop sequence if exists drop_ref_one_seq; drop table if exists `migtest_QuOtEd`; drop table if exists migtest_e_ref; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql index cdf8b7589c..388434adc1 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql @@ -11,6 +11,9 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_status_indextest1; alter table migtest_e_basic drop index uq_migtest_e_basic_name; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop foreign key fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql index cbc989b87d..e2f75756a7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.4__dropsFor_1.3.sql @@ -20,6 +20,13 @@ CALL usp_ebean_drop_column('migtest_e_history5', 'test_boolean'); CALL usp_ebean_drop_column('migtest_e_softdelete', 'deleted'); CALL usp_ebean_drop_column('migtest_oto_child', 'master_id'); -- apply post alter +drop table if exists drop_main; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 db53211817..4bd9b11177 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations @@ -1,8 +1,8 @@ -1933396282, I__create_procs.sql -1588268581, 1.0__initial.sql -993683171, 1.1.sql -1653772183, 1.2__dropsFor_1.1.sql --797191406, 1.3.sql -772508824, 1.4__dropsFor_1.3.sql +-1101751768, 1.1.sql +1187950993, 1.2__dropsFor_1.1.sql +-413458006, 1.3.sql +-430651388, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml index c2c04f4824..1c704408ca 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 @@ -103,9 +103,6 @@ - - - @@ -124,10 +121,6 @@ - - - - diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml index 4a4eb166d2..99fa64365b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml @@ -7,10 +7,6 @@ - - - - diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml index 3b4b2aca46..2041a1131e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml @@ -23,6 +23,7 @@ + @@ -51,6 +52,9 @@ + + + @@ -86,6 +90,10 @@ + + + + diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml index a18446b1a7..160798377b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.4__dropsFor_1.3.model.xml @@ -18,6 +18,10 @@ + + + + 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 b574bebf10..2b8461633d 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 @@ -4,9 +4,6 @@ alter table migtest_fk_cascade drop foreign key fk_migtest_fk_cascade_one_id; alter table migtest_fk_set_null drop foreign key fk_migtest_fk_set_null_one_id; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; 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`; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql index a9aee81d23..2c06ee0016 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql @@ -25,9 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column); end$$ unlock tables; -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists `migtest_QuOtEd`; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql index 50be0f46d9..72bfe3e01c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql @@ -11,6 +11,9 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_status_indextest1; alter table migtest_e_basic drop index uq_migtest_e_basic_name; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop foreign key fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql index f98131f6f8..73da644e8e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.4__dropsFor_1.3.sql @@ -77,6 +77,10 @@ create trigger table_history_del before delete on `table` for each row begin insert into table_history (sys_period_start,sys_period_end,`index`, `from`, `to`, `varchar`, `select`, `foreign`) values (OLD.sys_period_start, now(6),OLD.`index`, OLD.`from`, OLD.`to`, OLD.`varchar`, OLD.`select`, OLD.`foreign`); end$$ unlock tables; +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 43099e7904..805eb44597 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations @@ -1,8 +1,8 @@ -1933396282, I__create_procs.sql -1156696445, 1.0__initial.sql --1306874760, 1.1.sql --70834029, 1.2__dropsFor_1.1.sql -514784474, 1.3.sql --1282113429, 1.4__dropsFor_1.3.sql +-92753611, 1.1.sql +-1097227916, 1.2__dropsFor_1.1.sql +141196883, 1.3.sql +1435550240, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql 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 b574bebf10..2b8461633d 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 @@ -4,9 +4,6 @@ alter table migtest_fk_cascade drop foreign key fk_migtest_fk_cascade_one_id; alter table migtest_fk_set_null drop foreign key fk_migtest_fk_set_null_one_id; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; 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`; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql index a9aee81d23..2c06ee0016 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql @@ -25,9 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column); end$$ unlock tables; -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists `migtest_QuOtEd`; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql index 50be0f46d9..72bfe3e01c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql @@ -11,6 +11,9 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_status_indextest1; alter table migtest_e_basic drop index uq_migtest_e_basic_name; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop foreign key fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop foreign key fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop foreign key fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop foreign key fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.4__dropsFor_1.3.sql index f98131f6f8..73da644e8e 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.4__dropsFor_1.3.sql @@ -77,6 +77,10 @@ create trigger table_history_del before delete on `table` for each row begin insert into table_history (sys_period_start,sys_period_end,`index`, `from`, `to`, `varchar`, `select`, `foreign`) values (OLD.sys_period_start, now(6),OLD.`index`, OLD.`from`, OLD.`to`, OLD.`varchar`, OLD.`select`, OLD.`foreign`); end$$ unlock tables; +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 b756352369..503e38c465 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,8 +1,8 @@ -1933396282, I__create_procs.sql -165038024, 1.0__initial.sql --1306874760, 1.1.sql --70834029, 1.2__dropsFor_1.1.sql -514784474, 1.3.sql --1282113429, 1.4__dropsFor_1.3.sql +-92753611, 1.1.sql +-1097227916, 1.2__dropsFor_1.1.sql +141196883, 1.3.sql +1435550240, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql index 4684f5fcbe..31cdd37566 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2; 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 ck_migtest_e_enum_test_status; -alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql index 78bd786c6b..fc0eb25e3c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql @@ -27,13 +27,6 @@ create or replace trigger migtest_e_history2_history_del for migtest_e_history2 end_trigger; $$ -drop table if exists drop_main; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql index ed90925e97..ddb9e52b97 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql index 257fb38bda..5a8e4a8142 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.4__dropsFor_1.3.sql @@ -83,6 +83,13 @@ create or replace trigger table_history_del for "table" before delete for each r end_trigger; $$ +drop table if exists drop_main; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 223b29d61e..40897ee779 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations @@ -1,7 +1,7 @@ -588780599, 1.0__initial.sql -1864060880, 1.1.sql --1061962041, 1.2__dropsFor_1.1.sql --1346387712, 1.3.sql --1118858496, 1.4__dropsFor_1.3.sql +-2079708895, 1.1.sql +1530685455, 1.2__dropsFor_1.1.sql +-956168377, 1.3.sql +146295108, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql index cac7e177a9..f78c04b789 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 @@ -52,9 +52,6 @@ exception when expected_error then null; end; $$; -alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_drp_mn; -alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_dr_joeslj; -alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_quoted_status1; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql index 649b7ea47f..e3b0dbb969 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql @@ -7,40 +7,6 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table drop_main cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_main_seq'; -exception - when expected_error then null; -end; -$$; -drop table drop_main_drop_ref_many cascade constraints purge; -drop table drop_ref_many cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_ref_many_seq'; -exception - when expected_error then null; -end; -$$; -drop table drop_ref_one cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_ref_one_seq'; -exception - when expected_error then null; -end; -$$; drop table "migtest_QuOtEd" cascade constraints purge; drop table migtest_e_ref cascade constraints purge; delimiter $$ diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql index ad4d6de61f..dfbad8dd73 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql @@ -86,6 +86,9 @@ exception when expected_error then null; end; $$; +alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_drp_mn; +alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_dr_joeslj; +alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_mgtst_mtm_c_mgtst_mt_93awga; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_mgtst_mtm_c_mgtst_mt_93awgk; alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_mgtst_mtm_m_mgtst_mt_ggi34k; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql index 57b6f9a7ea..01046ec495 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.4__dropsFor_1.3.sql @@ -17,6 +17,40 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table drop_main cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_main_seq'; +exception + when expected_error then null; +end; +$$; +drop table drop_main_drop_ref_many cascade constraints purge; +drop table drop_ref_many cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_ref_many_seq'; +exception + when expected_error then null; +end; +$$; +drop table drop_ref_one cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_ref_one_seq'; +exception + when expected_error then null; +end; +$$; drop table migtest_e_user cascade constraints purge; delimiter $$ declare 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 3d21e91587..9b6a8abe87 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations @@ -1,8 +1,8 @@ -126940583, 1.0__initial.sql -1459805204, 1.1.sql -1164021503, 1.2__dropsFor_1.1.sql -1644022208, 1.3.sql -2037899598, 1.4__dropsFor_1.3.sql +740264587, 1.1.sql +930172034, 1.2__dropsFor_1.1.sql +-647790612, 1.3.sql +1707389466, 1.4__dropsFor_1.3.sql 1357801733, R__oracle_only_views.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql index 64c99f4941..7a24eef36c 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 @@ -52,9 +52,6 @@ exception when expected_error then null; end; $$; -alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_drp_mn; -alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_dr_joeslj; -alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_quoted_status1; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql index 649b7ea47f..e3b0dbb969 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql @@ -7,40 +7,6 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table drop_main cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_main_seq'; -exception - when expected_error then null; -end; -$$; -drop table drop_main_drop_ref_many cascade constraints purge; -drop table drop_ref_many cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_ref_many_seq'; -exception - when expected_error then null; -end; -$$; -drop table drop_ref_one cascade constraints purge; -delimiter $$ -declare - expected_error exception; - pragma exception_init(expected_error, -2289); -begin - execute immediate 'drop sequence drop_ref_one_seq'; -exception - when expected_error then null; -end; -$$; drop table "migtest_QuOtEd" cascade constraints purge; drop table migtest_e_ref cascade constraints purge; delimiter $$ diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql index 20a6509e70..e95be26430 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql @@ -86,6 +86,9 @@ exception when expected_error then null; end; $$; +alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_drp_mn; +alter table drop_main_drop_ref_many drop constraint fk_drp_mn_drp_rf_mny_dr_joeslj; +alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_mgtst_mtm_c_mgtst_mt_93awga; alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_mgtst_mtm_c_mgtst_mt_93awgk; alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_mgtst_mtm_m_mgtst_mt_ggi34k; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.4__dropsFor_1.3.sql index 57b6f9a7ea..01046ec495 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.4__dropsFor_1.3.sql @@ -17,6 +17,40 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table drop_main cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_main_seq'; +exception + when expected_error then null; +end; +$$; +drop table drop_main_drop_ref_many cascade constraints purge; +drop table drop_ref_many cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_ref_many_seq'; +exception + when expected_error then null; +end; +$$; +drop table drop_ref_one cascade constraints purge; +delimiter $$ +declare + expected_error exception; + pragma exception_init(expected_error, -2289); +begin + execute immediate 'drop sequence drop_ref_one_seq'; +exception + when expected_error then null; +end; +$$; drop table migtest_e_user cascade constraints purge; delimiter $$ declare 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 c33c3b049f..2fee87c5d3 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,8 +1,8 @@ 21261569, 1.0__initial.sql --1938703172, 1.1.sql -1164021503, 1.2__dropsFor_1.1.sql -1673954355, 1.3.sql -2037899598, 1.4__dropsFor_1.3.sql +-123689547, 1.1.sql +930172034, 1.2__dropsFor_1.1.sql +1369863782, 1.3.sql +1707389466, 1.4__dropsFor_1.3.sql 1357801733, R__oracle_only_views.sql 561281075, R__order_views.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql index d6bd7d5b04..3a0faaf28e 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql index 034b339081..7e6c962280 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql @@ -37,13 +37,6 @@ create trigger migtest_e_history2_history_upd before update or delete on migtest_e_history2 for each row execute procedure migtest_e_history2_history_version(); -drop table if exists drop_main cascade; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many cascade; -drop table if exists drop_ref_many cascade; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one cascade; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd" cascade; drop table if exists migtest_e_ref cascade; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql index 98c3c4f38d..b365f6e7b9 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table if exists migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql index abf1cd14d4..4920137107 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.4__dropsFor_1.3.sql @@ -113,6 +113,13 @@ create trigger table_history_upd before update or delete on "table" for each row execute procedure table_history_version(); +drop table if exists drop_main cascade; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many cascade; +drop table if exists drop_ref_many cascade; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one cascade; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; 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 3436367647..0dab559008 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations @@ -1,8 +1,8 @@ -22203872, 1.0__initial.sql --1122505568, 1.1.sql -274267648, 1.2__dropsFor_1.1.sql --1740230219, 1.3.sql --709144111, 1.4__dropsFor_1.3.sql +-1432572923, 1.1.sql +-261111052, 1.2__dropsFor_1.1.sql +788727457, 1.3.sql +-596521697, 1.4__dropsFor_1.3.sql 783227075, R__multi_comments.sql 561281075, R__order_views.sql 283077354, R__pg_indexes.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql index 7d1f82d873..f866990168 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql index 034b339081..7e6c962280 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql @@ -37,13 +37,6 @@ create trigger migtest_e_history2_history_upd before update or delete on migtest_e_history2 for each row execute procedure migtest_e_history2_history_version(); -drop table if exists drop_main cascade; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many cascade; -drop table if exists drop_ref_many cascade; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one cascade; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd" cascade; drop table if exists migtest_e_ref cascade; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql index 9bcc6701ab..1d5905ba3b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table if exists migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.4__dropsFor_1.3.sql index abf1cd14d4..4920137107 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.4__dropsFor_1.3.sql @@ -113,6 +113,13 @@ create trigger table_history_upd before update or delete on "table" for each row execute procedure table_history_version(); +drop table if exists drop_main cascade; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many cascade; +drop table if exists drop_ref_many cascade; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one cascade; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; 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 bd8d340405..a6ae1b7d87 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,8 +1,8 @@ 559327334, 1.0__initial.sql --1063437228, 1.1.sql -274267648, 1.2__dropsFor_1.1.sql --643994826, 1.3.sql --709144111, 1.4__dropsFor_1.3.sql +-690271384, 1.1.sql +-261111052, 1.2__dropsFor_1.1.sql +-1811829200, 1.3.sql +-596521697, 1.4__dropsFor_1.3.sql 783227075, R__multi_comments.sql 561281075, R__order_views.sql 283077354, R__pg_indexes.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql index 146b5ae716..f6c2af545e 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql index 5934a713ad..cb6860e639 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql @@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql index 218002613d..2e473b177d 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql index b7d11cb4df..52fd62211c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.4__dropsFor_1.3.sql @@ -17,6 +17,10 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 6118905bf3..06bb6b597f 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations @@ -1,6 +1,6 @@ 1278110701, 1.0__initial.sql --1462494667, 1.1.sql --875723380, 1.2__dropsFor_1.1.sql -813275522, 1.3.sql -255653518, 1.4__dropsFor_1.3.sql +128425002, 1.1.sql +688811494, 1.2__dropsFor_1.1.sql +-680526370, 1.3.sql +677297367, 1.4__dropsFor_1.3.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql index 50fa3d06aa..3c93d203cd 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 @@ -7,9 +7,6 @@ -- not supported: alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2; -- not supported: alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6; -- not supported: alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; --- not supported: alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; --- not supported: alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; --- not supported: alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql index 5934a713ad..cb6860e639 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql @@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id; alter table migtest_e_history2 drop column obsolete_string1; alter table migtest_e_history2 drop column obsolete_string2; -- apply post alter -drop table if exists drop_main; -drop table if exists drop_main_drop_ref_many; -drop table if exists drop_ref_many; -drop table if exists drop_ref_one; drop table if exists "migtest_QuOtEd"; drop table if exists migtest_e_ref; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql index acc7061102..65871be2b7 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql @@ -14,6 +14,9 @@ -- not supported: alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; -- not supported: alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; -- not supported: alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +-- not supported: alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +-- not supported: alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +-- not supported: alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; -- not supported: alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; -- not supported: alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; -- not supported: alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql index b7d11cb4df..52fd62211c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.4__dropsFor_1.3.sql @@ -17,6 +17,10 @@ alter table migtest_e_history5 drop column test_boolean; alter table migtest_e_softdelete drop column deleted; alter table migtest_oto_child drop column master_id; -- apply post alter +drop table if exists drop_main; +drop table if exists drop_main_drop_ref_many; +drop table if exists drop_ref_many; +drop table if exists drop_ref_one; drop table if exists migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; drop table if exists migtest_mtm_m_migtest_mtm_c; 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 2611138cc7..ce94a01e19 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations @@ -1,7 +1,7 @@ 238997470, 1.0__initial.sql --1940818706, 1.1.sql --875723380, 1.2__dropsFor_1.1.sql -1218248753, 1.3.sql -255653518, 1.4__dropsFor_1.3.sql +1828386122, 1.1.sql +688811494, 1.2__dropsFor_1.1.sql +142780650, 1.3.sql +677297367, 1.4__dropsFor_1.3.sql 2034589659, R__order_views_sqlite.sql 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 dcea52c875..fd69bd2dd0 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 @@ -9,9 +9,6 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest2', 'UQ') IS NOT NULL alter table migt IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'uq_migtest_e_basic_indextest6') drop index uq_migtest_e_basic_indextest6 ON migtest_e_basic; IF OBJECT_ID('uq_migtest_e_basic_indextest6', 'UQ') IS NOT NULL alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6; IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status; -IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_main', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; -IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_ref_many', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; -IF OBJECT_ID('fk_drop_ref_one_parent_id', 'F') IS NOT NULL alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest1') drop index ix_migtest_e_basic_indextest1 ON migtest_e_basic; 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"; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql index 12dd0f8e05..e37f34d7c6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql @@ -11,13 +11,6 @@ EXEC usp_ebean_drop_column migtest_e_basic, eref_id; EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string1; EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string2; -- apply post alter -IF OBJECT_ID('drop_main', 'U') IS NOT NULL drop table drop_main; -IF OBJECT_ID('drop_main_seq', 'SO') IS NOT NULL drop sequence drop_main_seq; -IF OBJECT_ID('drop_main_drop_ref_many', 'U') IS NOT NULL drop table drop_main_drop_ref_many; -IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many; -IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq; -IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one; -IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq; IF OBJECT_ID('"migtest_QuOtEd"', 'U') IS NOT NULL drop table "migtest_QuOtEd"; IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref; IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql index 66c23e764e..3a9f7398e0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql @@ -19,6 +19,9 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest4', 'UQ') IS NOT NULL alter table migt IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'uq_migtest_e_basic_indextest5') drop index uq_migtest_e_basic_indextest5 ON migtest_e_basic; IF OBJECT_ID('uq_migtest_e_basic_indextest5', 'UQ') IS NOT NULL alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status; +IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_main', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; +IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_ref_many', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; +IF OBJECT_ID('fk_drop_ref_one_parent_id', 'F') IS NOT NULL alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; IF OBJECT_ID('fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c', 'F') IS NOT NULL alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; IF OBJECT_ID('fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m', 'F') IS NOT NULL alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; IF OBJECT_ID('fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m', 'F') IS NOT NULL alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.4__dropsFor_1.3.sql index feeefad502..3c841d11c0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.4__dropsFor_1.3.sql @@ -36,6 +36,13 @@ EXEC usp_ebean_drop_column migtest_e_softdelete, deleted; EXEC usp_ebean_drop_column migtest_oto_child, master_id; -- apply post alter IF OBJECT_ID('migtest_e_history_history', 'U') IS NOT NULL drop table migtest_e_history_history; +IF OBJECT_ID('drop_main', 'U') IS NOT NULL drop table drop_main; +IF OBJECT_ID('drop_main_seq', 'SO') IS NOT NULL drop sequence drop_main_seq; +IF OBJECT_ID('drop_main_drop_ref_many', 'U') IS NOT NULL drop table drop_main_drop_ref_many; +IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many; +IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq; +IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one; +IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq; IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user; IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq; IF OBJECT_ID('migtest_mtm_c_migtest_mtm_m', 'U') IS NOT NULL drop table migtest_mtm_c_migtest_mtm_m; 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 653ec2bed3..dd52a9c473 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,8 +1,8 @@ 891357544, I__create_procs.sql 254353963, 1.0__initial.sql -523634078, 1.1.sql --599071889, 1.2__dropsFor_1.1.sql --1831804381, 1.3.sql --628940135, 1.4__dropsFor_1.3.sql +1327099983, 1.1.sql +-1431095657, 1.2__dropsFor_1.1.sql +1846195516, 1.3.sql +-1390979787, 1.4__dropsFor_1.3.sql 1607822082, R__order_views_mssql.sql 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 50ec42dc76..c6a7c1466c 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 @@ -9,9 +9,6 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest2', 'UQ') IS NOT NULL alter table migt IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'uq_migtest_e_basic_indextest6') drop index uq_migtest_e_basic_indextest6 ON migtest_e_basic; IF OBJECT_ID('uq_migtest_e_basic_indextest6', 'UQ') IS NOT NULL alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6; IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status; -IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_main', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; -IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_ref_many', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; -IF OBJECT_ID('fk_drop_ref_one_parent_id', 'F') IS NOT NULL alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest1') drop index ix_migtest_e_basic_indextest1 ON migtest_e_basic; 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"; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql index 12dd0f8e05..e37f34d7c6 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql @@ -11,13 +11,6 @@ EXEC usp_ebean_drop_column migtest_e_basic, eref_id; EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string1; EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string2; -- apply post alter -IF OBJECT_ID('drop_main', 'U') IS NOT NULL drop table drop_main; -IF OBJECT_ID('drop_main_seq', 'SO') IS NOT NULL drop sequence drop_main_seq; -IF OBJECT_ID('drop_main_drop_ref_many', 'U') IS NOT NULL drop table drop_main_drop_ref_many; -IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many; -IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq; -IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one; -IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq; IF OBJECT_ID('"migtest_QuOtEd"', 'U') IS NOT NULL drop table "migtest_QuOtEd"; IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref; IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql index a48483a2be..d42bcd654c 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql @@ -19,6 +19,9 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest4', 'UQ') IS NOT NULL alter table migt IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'uq_migtest_e_basic_indextest5') drop index uq_migtest_e_basic_indextest5 ON migtest_e_basic; IF OBJECT_ID('uq_migtest_e_basic_indextest5', 'UQ') IS NOT NULL alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status; +IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_main', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main; +IF OBJECT_ID('fk_drop_main_drop_ref_many_drop_ref_many', 'F') IS NOT NULL alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many; +IF OBJECT_ID('fk_drop_ref_one_parent_id', 'F') IS NOT NULL alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id; IF OBJECT_ID('fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c', 'F') IS NOT NULL alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; IF OBJECT_ID('fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m', 'F') IS NOT NULL alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; IF OBJECT_ID('fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m', 'F') IS NOT NULL alter table migtest_mtm_m_migtest_mtm_c drop constraint fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.4__dropsFor_1.3.sql index feeefad502..3c841d11c0 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.4__dropsFor_1.3.sql @@ -36,6 +36,13 @@ EXEC usp_ebean_drop_column migtest_e_softdelete, deleted; EXEC usp_ebean_drop_column migtest_oto_child, master_id; -- apply post alter IF OBJECT_ID('migtest_e_history_history', 'U') IS NOT NULL drop table migtest_e_history_history; +IF OBJECT_ID('drop_main', 'U') IS NOT NULL drop table drop_main; +IF OBJECT_ID('drop_main_seq', 'SO') IS NOT NULL drop sequence drop_main_seq; +IF OBJECT_ID('drop_main_drop_ref_many', 'U') IS NOT NULL drop table drop_main_drop_ref_many; +IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many; +IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq; +IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one; +IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq; IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user; IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq; IF OBJECT_ID('migtest_mtm_c_migtest_mtm_m', 'U') IS NOT NULL drop table migtest_mtm_c_migtest_mtm_m; 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 fbc34927a8..29d90f613e 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,8 +1,8 @@ 891357544, I__create_procs.sql -2080592180, 1.0__initial.sql -1381251697, 1.1.sql --599071889, 1.2__dropsFor_1.1.sql -495243310, 1.3.sql --628940135, 1.4__dropsFor_1.3.sql +-579377447, 1.1.sql +-1431095657, 1.2__dropsFor_1.1.sql +-1712303917, 1.3.sql +-1390979787, 1.4__dropsFor_1.3.sql 1607822082, R__order_views_mssql.sql diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql index 5b95bf05bc..f6a1e56ff8 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 @@ -7,9 +7,6 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2 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; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; -alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; -alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; 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; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql index 034b339081..7e6c962280 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql @@ -37,13 +37,6 @@ create trigger migtest_e_history2_history_upd before update or delete on migtest_e_history2 for each row execute procedure migtest_e_history2_history_version(); -drop table if exists drop_main cascade; -drop sequence if exists drop_main_seq; -drop table if exists drop_main_drop_ref_many cascade; -drop table if exists drop_ref_many cascade; -drop sequence if exists drop_ref_many_seq; -drop table if exists drop_ref_one cascade; -drop sequence if exists drop_ref_one_seq; drop table if exists "migtest_QuOtEd" cascade; drop table if exists migtest_e_ref cascade; drop sequence if exists migtest_e_ref_seq; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql index 602fd13953..58c1616288 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql @@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4; alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main; +alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many; +alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c; alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m; alter table if exists migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql index abf1cd14d4..4920137107 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.4__dropsFor_1.3.sql @@ -113,6 +113,13 @@ create trigger table_history_upd before update or delete on "table" for each row execute procedure table_history_version(); +drop table if exists drop_main cascade; +drop sequence if exists drop_main_seq; +drop table if exists drop_main_drop_ref_many cascade; +drop table if exists drop_ref_many cascade; +drop sequence if exists drop_ref_many_seq; +drop table if exists drop_ref_one cascade; +drop sequence if exists drop_ref_one_seq; drop table if exists migtest_e_user cascade; drop sequence if exists migtest_e_user_seq; drop table if exists migtest_mtm_c_migtest_mtm_m cascade; 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 b8a5fe169b..a3e8f8961b 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations @@ -1,7 +1,7 @@ 1799266243, 1.0__initial.sql -1894754300, 1.1.sql -274267648, 1.2__dropsFor_1.1.sql -195217400, 1.3.sql --709144111, 1.4__dropsFor_1.3.sql +-1967687506, 1.1.sql +-261111052, 1.2__dropsFor_1.1.sql +-526466104, 1.3.sql +-596521697, 1.4__dropsFor_1.3.sql 561281075, R__order_views.sql