diff --git a/ebean-ddl-generator/src/test/resources/assert/BaseDdlHandlerTest/baseApply.sql b/ebean-ddl-generator/src/test/resources/assert/BaseDdlHandlerTest/baseApply.sql index 1513ea2b6..46f430bce 100644 --- a/ebean-ddl-generator/src/test/resources/assert/BaseDdlHandlerTest/baseApply.sql +++ b/ebean-ddl-generator/src/test/resources/assert/BaseDdlHandlerTest/baseApply.sql @@ -7,8 +7,6 @@ create table foo ( ); comment on table foo is 'comment'; - - -- apply alter tables alter table foo add column added_to_foo varchar(20); alter table foo drop column col2; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql index b64384f89..56fd182db 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.1.sql @@ -26,24 +26,17 @@ create table migtest_mtm_m_phone_numbers ( ) ENGINE = Log(); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key UInt32; alter table migtest_ckey_detail add column two_key String; diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql index 98277088c..155817baa 100644 --- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql +++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql @@ -19,8 +19,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 ece294d59..0d9764f59 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 @@ -33,24 +33,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql index 7c0c0630c..f25812e9b 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 @@ -29,8 +29,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 f54e7696c..f5892d818 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 @@ -33,8 +33,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- db2 does not support parial null indices :( - so we have to clean; @@ -42,16 +40,11 @@ update migtest_e_basic set status = 'N' where id = 1; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql index 4a6495765..58eac737a 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 @@ -28,8 +28,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 d682d60a1..97a658a2c 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 @@ -33,8 +33,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- db2 does not support parial null indices :( - so we have to clean; @@ -42,16 +40,11 @@ update migtest_e_basic set status = 'N' where id = 1; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql index 181e31aab..ab7160575 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 @@ -28,8 +28,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 c17747fe9..ad5b24dae 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 @@ -33,8 +33,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- db2 does not support parial null indices :( - so we have to clean; @@ -42,16 +40,11 @@ update migtest_e_basic set status = 'N' where id = 1; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql index 5f1ca5a3c..082757e88 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 @@ -28,8 +28,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 c17747fe9..ad5b24dae 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 @@ -33,8 +33,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- db2 does not support parial null indices :( - so we have to clean; @@ -42,16 +40,11 @@ update migtest_e_basic set status = 'N' where id = 1; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql index 5f1ca5a3c..082757e88 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 @@ -28,8 +28,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 e1d5da6b9..8bb1a8a35 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 @@ -33,24 +33,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql index d16cbd509..646c698cc 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 @@ -29,8 +29,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 3b0696cb5..186ab2a4c 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 @@ -37,26 +37,19 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history add column sys_period_start timestamp default now(); alter table migtest_e_history add column sys_period_end timestamp; -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql index 246a5ca88..b4162cd3b 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 @@ -32,8 +32,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 967a98d1b..6127958eb 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 @@ -75,29 +75,22 @@ create column table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history2 drop system versioning; -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - alter table migtest_e_history3 drop system versioning; alter table migtest_e_history4 drop system versioning; alter table migtest_e_history5 drop system versioning; - alter table migtest_e_history6 drop system versioning; -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add (one_key integer, two_key nvarchar(127)); 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 3bc9135cd..14a60d921 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 @@ -1,8 +1,6 @@ -- Migrationscripts for ebean unittest -- apply changes alter table migtest_e_history2 drop system versioning; - - -- apply alter tables CALL usp_ebean_drop_column('migtest_e_basic', 'description_file'); CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean'); 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 c5997a1b8..4a9911a7a 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 @@ -88,9 +88,7 @@ create column table migtest_e_ref ( update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - alter table migtest_e_history2 drop system versioning; - alter table migtest_e_history3 drop system versioning; alter table migtest_e_history4 drop system versioning; alter table migtest_e_history6 drop system versioning; 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 d80ecf525..d49afa4be 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 @@ -6,13 +6,7 @@ alter table migtest_e_history drop (sys_period_start,sys_period_end); drop table migtest_e_history_history cascade; -- apply changes alter table migtest_e_history2 drop system versioning; - - - alter table migtest_e_history5 drop system versioning; - - - -- apply alter tables CALL usp_ebean_drop_column('migtest_ckey_detail', 'one_key'); CALL usp_ebean_drop_column('migtest_ckey_detail', 'two_key'); 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 a2b45fdc4..74863033d 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 @@ -33,24 +33,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql index 9f375ed10..bd7a074f3 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 @@ -29,8 +29,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 7f604446f..ddfb0a1f8 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 @@ -30,8 +30,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic modify status varchar(1) not null default 'A'; alter table migtest_e_basic modify status2 varchar(127); @@ -40,23 +38,18 @@ alter table migtest_e_basic modify status2 varchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic modify user_id integer; - alter table migtest_e_history modify test_string bigint; -- NOTE: table has @History - special migration may be necessary SET @@system_versioning_alter_history = 1; update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 modify test_string varchar(255) not null default 'unknown'; - alter table migtest_e_history4 modify test_number bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; alter table migtest_e_history6 modify test_number1 integer not null default 42; alter table migtest_e_history6 modify test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql index d27de2829..ec0d2b884 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 @@ -28,9 +28,7 @@ alter table migtest_e_basic modify status2 varchar(1) not null default 'N'; update migtest_e_basic set user_id = 23 where user_id is null; alter table migtest_e_basic modify user_id integer not null default 23; - alter table migtest_e_history2 modify test_string varchar(255); - alter table migtest_e_history4 modify test_number integer; alter table migtest_e_history6 modify test_number1 integer; 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 7f604446f..ddfb0a1f8 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 @@ -30,8 +30,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic modify status varchar(1) not null default 'A'; alter table migtest_e_basic modify status2 varchar(127); @@ -40,23 +38,18 @@ alter table migtest_e_basic modify status2 varchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic modify user_id integer; - alter table migtest_e_history modify test_string bigint; -- NOTE: table has @History - special migration may be necessary SET @@system_versioning_alter_history = 1; update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 modify test_string varchar(255) not null default 'unknown'; - alter table migtest_e_history4 modify test_number bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; alter table migtest_e_history6 modify test_number1 integer not null default 42; alter table migtest_e_history6 modify test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql index 2a8c1ece1..3a55160b8 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 @@ -1,17 +1,11 @@ -- Migrationscripts for ebean unittest -- apply changes CALL usp_ebean_drop_column('migtest_e_basic', 'description_file'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean2'); - 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'); - drop sequence if exists migtest_e_ref_seq; -- apply post alter drop table if exists migtest_e_ref; 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 d27de2829..ec0d2b884 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 @@ -28,9 +28,7 @@ alter table migtest_e_basic modify status2 varchar(1) not null default 'N'; update migtest_e_basic set user_id = 23 where user_id is null; alter table migtest_e_basic modify user_id integer not null default 23; - alter table migtest_e_history2 modify test_string varchar(255); - alter table migtest_e_history4 modify test_number integer; alter table migtest_e_history6 modify test_number1 integer; 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 950cde542..13b52ccec 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 @@ -1,33 +1,19 @@ -- Migrationscripts for ebean unittest -- apply changes CALL usp_ebean_drop_column('migtest_ckey_detail', 'one_key'); - CALL usp_ebean_drop_column('migtest_ckey_detail', 'two_key'); - CALL usp_ebean_drop_column('migtest_ckey_parent', 'assoc_id'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_string_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field2'); - CALL usp_ebean_drop_column('migtest_e_basic', 'progress'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_integer'); - CALL usp_ebean_drop_column('migtest_e_history2', 'test_string2'); - CALL usp_ebean_drop_column('migtest_e_history2', 'test_string3'); - CALL usp_ebean_drop_column('migtest_e_history2', 'new_column'); - 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'); - drop sequence if exists migtest_e_user_seq; -- apply post alter drop table if exists migtest_e_user; 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 44fefb2e3..a4c4ca642 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 @@ -34,8 +34,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic modify status varchar(1) not null default 'A'; alter table migtest_e_basic modify status2 varchar(127); @@ -44,7 +42,6 @@ alter table migtest_e_basic modify status2 varchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic modify user_id integer; - alter table migtest_e_history add column sys_period_start datetime(6) default now(6); alter table migtest_e_history add column sys_period_end datetime(6); alter table migtest_e_history modify test_string bigint; @@ -52,17 +49,13 @@ alter table migtest_e_history modify test_string bigint; -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 modify test_string varchar(255) not null default 'unknown'; - alter table migtest_e_history4 modify test_number bigint; alter table migtest_e_history4_history modify test_number bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; alter table migtest_e_history6 modify test_number1 integer not null default 42; alter table migtest_e_history6 modify test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql index acaf96272..72d889059 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 @@ -3,19 +3,13 @@ drop view if exists migtest_e_history2_with_history; -- apply changes CALL usp_ebean_drop_column('migtest_e_basic', 'description_file'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean2'); - 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_history', 'obsolete_string1'); - CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2'); - -- apply post alter drop table if exists migtest_e_ref; -- apply history view 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 21e91ff96..5dee0b540 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 @@ -31,9 +31,7 @@ alter table migtest_e_basic modify status2 varchar(1) not null default 'N'; update migtest_e_basic set user_id = 23 where user_id is null; alter table migtest_e_basic modify user_id integer not null default 23; - alter table migtest_e_history2 modify test_string varchar(255); - alter table migtest_e_history4 modify test_number integer; alter table migtest_e_history4_history modify test_number integer; alter table migtest_e_history6 modify test_number1 integer; 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 f257f1ebb..38b1d2503 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 @@ -9,39 +9,25 @@ drop view if exists migtest_e_history2_with_history; drop view if exists migtest_e_history5_with_history; -- apply changes CALL usp_ebean_drop_column('migtest_ckey_detail', 'one_key'); - CALL usp_ebean_drop_column('migtest_ckey_detail', 'two_key'); - CALL usp_ebean_drop_column('migtest_ckey_parent', 'assoc_id'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_string_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field2'); - CALL usp_ebean_drop_column('migtest_e_basic', 'progress'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_integer'); - CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_start'); CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_end'); CALL usp_ebean_drop_column('migtest_e_history2', 'test_string2'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string2'); - CALL usp_ebean_drop_column('migtest_e_history2', 'test_string3'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string3'); - CALL usp_ebean_drop_column('migtest_e_history2', 'new_column'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'new_column'); - CALL usp_ebean_drop_column('migtest_e_history5', 'test_boolean'); CALL usp_ebean_drop_column('migtest_e_history5_history', '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 migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 44fefb2e3..a4c4ca642 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 @@ -34,8 +34,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic modify status varchar(1) not null default 'A'; alter table migtest_e_basic modify status2 varchar(127); @@ -44,7 +42,6 @@ alter table migtest_e_basic modify status2 varchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic modify user_id integer; - alter table migtest_e_history add column sys_period_start datetime(6) default now(6); alter table migtest_e_history add column sys_period_end datetime(6); alter table migtest_e_history modify test_string bigint; @@ -52,17 +49,13 @@ alter table migtest_e_history modify test_string bigint; -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; alter table migtest_e_history2 modify test_string varchar(255) not null default 'unknown'; - alter table migtest_e_history4 modify test_number bigint; alter table migtest_e_history4_history modify test_number bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; alter table migtest_e_history6 modify test_number1 integer not null default 42; alter table migtest_e_history6 modify test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql index acaf96272..72d889059 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 @@ -3,19 +3,13 @@ drop view if exists migtest_e_history2_with_history; -- apply changes CALL usp_ebean_drop_column('migtest_e_basic', 'description_file'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean'); - CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean2'); - 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_history', 'obsolete_string1'); - CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2'); - -- apply post alter drop table if exists migtest_e_ref; -- apply history view 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 21e91ff96..5dee0b540 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 @@ -31,9 +31,7 @@ alter table migtest_e_basic modify status2 varchar(1) not null default 'N'; update migtest_e_basic set user_id = 23 where user_id is null; alter table migtest_e_basic modify user_id integer not null default 23; - alter table migtest_e_history2 modify test_string varchar(255); - alter table migtest_e_history4 modify test_number integer; alter table migtest_e_history4_history modify test_number integer; alter table migtest_e_history6 modify test_number1 integer; 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 f257f1ebb..38b1d2503 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 @@ -9,39 +9,25 @@ drop view if exists migtest_e_history2_with_history; drop view if exists migtest_e_history5_with_history; -- apply changes CALL usp_ebean_drop_column('migtest_ckey_detail', 'one_key'); - CALL usp_ebean_drop_column('migtest_ckey_detail', 'two_key'); - CALL usp_ebean_drop_column('migtest_ckey_parent', 'assoc_id'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_string_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field2'); - CALL usp_ebean_drop_column('migtest_e_basic', 'progress'); - CALL usp_ebean_drop_column('migtest_e_basic', 'new_integer'); - CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_start'); CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_end'); CALL usp_ebean_drop_column('migtest_e_history2', 'test_string2'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string2'); - CALL usp_ebean_drop_column('migtest_e_history2', 'test_string3'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string3'); - CALL usp_ebean_drop_column('migtest_e_history2', 'new_column'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'new_column'); - CALL usp_ebean_drop_column('migtest_e_history5', 'test_boolean'); CALL usp_ebean_drop_column('migtest_e_history5_history', '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 migtest_e_user; drop table if exists migtest_mtm_c_migtest_mtm_m; 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 df52221b6..7f3a24f9f 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 @@ -37,26 +37,19 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history add column sys_period_start datetime(6) default now(); alter table migtest_e_history add column sys_period_end datetime(6); -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql index 377e1b9b3..9dd55f8d9 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 @@ -32,8 +32,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 1bca2a9bb..a545c2b46 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 @@ -78,24 +78,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add one_key number(10); alter table migtest_ckey_detail add two_key varchar2(127); 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 fcdce368f..511fa9f21 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 @@ -101,8 +101,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 484b157b6..e7d4963b5 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 @@ -79,24 +79,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add one_key number(10); alter table migtest_ckey_detail add two_key varchar2(127); 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 546b71375..06f32cbd8 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 @@ -102,8 +102,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 73f06c071..d56a58827 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 @@ -40,15 +40,12 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic alter column status2 type varchar(127) using status2::varchar(127); -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history add column sys_period tstzrange not null default tstzrange(current_timestamp, null); alter table migtest_e_history alter column test_string TYPE bigint USING (test_string::integer); @@ -56,15 +53,11 @@ alter table migtest_e_history alter column test_string type bigint using test_st -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - alter table migtest_e_history4 alter column test_number type bigint using test_number::bigint; alter table migtest_e_history4_history alter column test_number type bigint using test_number::bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql index 74a65cbce..f2e623957 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 @@ -32,8 +32,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; alter table migtest_e_basic alter column status2 type varchar(1) using status2::varchar(1); update migtest_e_basic set user_id = 23 where user_id is null; - - alter table migtest_e_history4 alter column test_number type integer using test_number::integer; alter table migtest_e_history4_history alter column test_number type integer using test_number::integer; 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 9aa225d4b..4c87d8179 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 @@ -40,15 +40,12 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic alter column status2 type varchar(127) using status2::varchar(127); -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history add column sys_period tstzrange not null default tstzrange(current_timestamp, null); alter table migtest_e_history alter column test_string TYPE bigint USING (test_string::integer); @@ -56,15 +53,11 @@ alter table migtest_e_history alter column test_string type bigint using test_st -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - alter table migtest_e_history4 alter column test_number type bigint using test_number::bigint; alter table migtest_e_history4_history alter column test_number type bigint using test_number::bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql index 4886f5135..c61552550 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 @@ -32,8 +32,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; alter table migtest_e_basic alter column status2 type varchar(1) using status2::varchar(1); update migtest_e_basic set user_id = 23 where user_id is null; - - alter table migtest_e_history4 alter column test_number type integer using test_number::integer; alter table migtest_e_history4_history alter column test_number type integer using test_number::integer; 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 2c1ef3190..ba24ed39b 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 @@ -33,24 +33,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql index 48e8e1396..ac474a234 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 @@ -29,8 +29,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 354bc0cab..24c69d51b 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 @@ -38,24 +38,17 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql index 8b5d83414..e7851f49c 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 @@ -29,8 +29,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; update migtest_e_basic set user_id = 23 where user_id is null; - - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number2 = 7 where test_number2 is null; -- apply alter tables 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 df57db575..29aa7ed4a 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 @@ -35,8 +35,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; EXEC usp_ebean_drop_default_constraint migtest_e_basic, status; alter table migtest_e_basic alter column status varchar(1) not null; @@ -48,7 +46,6 @@ alter table migtest_e_basic alter column status2 varchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic alter column user_id integer; - alter table migtest_e_history alter column test_string numeric(19); -- NOTE: table has @History - special migration may be necessary @@ -56,18 +53,14 @@ update migtest_e_history2 set test_string = 'unknown' where test_string is null; EXEC usp_ebean_drop_default_constraint migtest_e_history2, test_string; alter table migtest_e_history2 alter column test_string varchar(255) not null; alter table migtest_e_history2 add default 'unknown' for test_string; - alter table migtest_e_history4 alter column test_number numeric(19); - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number1; alter table migtest_e_history6 alter column test_number1 integer not null; alter table migtest_e_history6 add default 42 for test_number1; alter table migtest_e_history6 alter column test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add one_key integer; alter table migtest_ckey_detail add two_key varchar(127); 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 fd32a937e..f3720c11c 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 @@ -1,17 +1,11 @@ -- Migrationscripts for ebean unittest -- apply changes EXEC usp_ebean_drop_column migtest_e_basic, description_file; - EXEC usp_ebean_drop_column migtest_e_basic, old_boolean; - EXEC usp_ebean_drop_column migtest_e_basic, old_boolean2; - 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; - IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq; -- apply post alter IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref; 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 f82baec72..89198bd71 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 @@ -40,10 +40,8 @@ update migtest_e_basic set user_id = 23 where user_id is null; EXEC usp_ebean_drop_default_constraint migtest_e_basic, user_id; alter table migtest_e_basic alter column user_id integer not null; alter table migtest_e_basic add default 23 for user_id; - EXEC usp_ebean_drop_default_constraint migtest_e_history2, test_string; alter table migtest_e_history2 alter column test_string varchar(255); - alter table migtest_e_history4 alter column test_number integer; EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number1; alter table migtest_e_history6 alter column test_number1 integer; 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 953d8abd0..2499bb58a 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 @@ -1,33 +1,19 @@ -- Migrationscripts for ebean unittest -- apply changes EXEC usp_ebean_drop_column migtest_ckey_detail, one_key; - EXEC usp_ebean_drop_column migtest_ckey_detail, two_key; - EXEC usp_ebean_drop_column migtest_ckey_parent, assoc_id; - EXEC usp_ebean_drop_column migtest_e_basic, new_string_field; - EXEC usp_ebean_drop_column migtest_e_basic, new_boolean_field; - EXEC usp_ebean_drop_column migtest_e_basic, new_boolean_field2; - EXEC usp_ebean_drop_column migtest_e_basic, progress; - EXEC usp_ebean_drop_column migtest_e_basic, new_integer; - EXEC usp_ebean_drop_column migtest_e_history2, test_string2; - EXEC usp_ebean_drop_column migtest_e_history2, test_string3; - EXEC usp_ebean_drop_column migtest_e_history2, new_column; - EXEC usp_ebean_drop_column migtest_e_history5, test_boolean; - EXEC usp_ebean_drop_column migtest_e_softdelete, deleted; - EXEC usp_ebean_drop_column migtest_oto_child, master_id; - IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq; -- apply post alter IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user; 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 839f25225..dd16610ee 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 @@ -36,8 +36,6 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; EXEC usp_ebean_drop_default_constraint migtest_e_basic, status; alter table migtest_e_basic alter column status nvarchar(1) not null; @@ -49,7 +47,6 @@ alter table migtest_e_basic alter column status2 nvarchar(127); insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; alter table migtest_e_basic alter column user_id integer; - alter table migtest_e_history alter column test_string numeric(19); -- NOTE: table has @History - special migration may be necessary @@ -57,18 +54,14 @@ update migtest_e_history2 set test_string = 'unknown' where test_string is null; EXEC usp_ebean_drop_default_constraint migtest_e_history2, test_string; alter table migtest_e_history2 alter column test_string nvarchar(255) not null; alter table migtest_e_history2 add default 'unknown' for test_string; - alter table migtest_e_history4 alter column test_number numeric(19); - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number1; alter table migtest_e_history6 alter column test_number1 integer not null; alter table migtest_e_history6 add default 42 for test_number1; alter table migtest_e_history6 alter column test_number2 integer; - - -- apply alter tables alter table migtest_ckey_detail add one_key integer; alter table migtest_ckey_detail add two_key nvarchar(127); 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 fd32a937e..f3720c11c 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 @@ -1,17 +1,11 @@ -- Migrationscripts for ebean unittest -- apply changes EXEC usp_ebean_drop_column migtest_e_basic, description_file; - EXEC usp_ebean_drop_column migtest_e_basic, old_boolean; - EXEC usp_ebean_drop_column migtest_e_basic, old_boolean2; - 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; - IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq; -- apply post alter IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref; 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 d7b8151ec..b303d0bb9 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 @@ -41,10 +41,8 @@ update migtest_e_basic set user_id = 23 where user_id is null; EXEC usp_ebean_drop_default_constraint migtest_e_basic, user_id; alter table migtest_e_basic alter column user_id integer not null; alter table migtest_e_basic add default 23 for user_id; - EXEC usp_ebean_drop_default_constraint migtest_e_history2, test_string; alter table migtest_e_history2 alter column test_string nvarchar(255); - alter table migtest_e_history4 alter column test_number integer; EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number1; alter table migtest_e_history6 alter column test_number1 integer; 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 953d8abd0..2499bb58a 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 @@ -1,33 +1,19 @@ -- Migrationscripts for ebean unittest -- apply changes EXEC usp_ebean_drop_column migtest_ckey_detail, one_key; - EXEC usp_ebean_drop_column migtest_ckey_detail, two_key; - EXEC usp_ebean_drop_column migtest_ckey_parent, assoc_id; - EXEC usp_ebean_drop_column migtest_e_basic, new_string_field; - EXEC usp_ebean_drop_column migtest_e_basic, new_boolean_field; - EXEC usp_ebean_drop_column migtest_e_basic, new_boolean_field2; - EXEC usp_ebean_drop_column migtest_e_basic, progress; - EXEC usp_ebean_drop_column migtest_e_basic, new_integer; - EXEC usp_ebean_drop_column migtest_e_history2, test_string2; - EXEC usp_ebean_drop_column migtest_e_history2, test_string3; - EXEC usp_ebean_drop_column migtest_e_history2, new_column; - EXEC usp_ebean_drop_column migtest_e_history5, test_boolean; - EXEC usp_ebean_drop_column migtest_e_softdelete, deleted; - EXEC usp_ebean_drop_column migtest_oto_child, master_id; - IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq; -- apply post alter IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user; 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 e80bbe2f3..88fd0b445 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 @@ -37,29 +37,22 @@ create table migtest_mtm_m_phone_numbers ( ); - - update migtest_e_basic set status = 'A' where status is null; alter table migtest_e_basic alter column status2 type varchar(127) using status2::varchar(127); -- rename all collisions; insert into migtest_e_user (id) select distinct user_id from migtest_e_basic; - alter table migtest_e_history add column sys_period tstzrange not null default tstzrange(current_timestamp, null); alter table migtest_e_history alter column test_string type bigint using test_string::bigint; -- NOTE: table has @History - special migration may be necessary update migtest_e_history2 set test_string = 'unknown' where test_string is null; - alter table migtest_e_history4 alter column test_number type bigint using test_number::bigint; alter table migtest_e_history4_history alter column test_number type bigint using test_number::bigint; - -- NOTE: table has @History - special migration may be necessary update migtest_e_history6 set test_number1 = 42 where test_number1 is null; - - -- apply alter tables alter table migtest_ckey_detail add column one_key integer; alter table migtest_ckey_detail add column two_key varchar(127); diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql index 167a45ae4..a981ac966 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 @@ -32,8 +32,6 @@ update migtest_e_basic set status2 = 'N' where status2 is null; alter table migtest_e_basic alter column status2 type varchar(1) using status2::varchar(1); update migtest_e_basic set user_id = 23 where user_id is null; - - alter table migtest_e_history4 alter column test_number type integer using test_number::integer; alter table migtest_e_history4_history alter column test_number type integer using test_number::integer;