diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
index a64383897..20ebe89e7 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
@@ -77,7 +77,7 @@ create table migtest_e_basic (
constraint ck_migtest_e_basic_status check ( status in ('N','A','I')),
constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I')),
constraint pk_migtest_e_basic primary key (id)
-);
+) in TSTABLES index in INDEXTS long in TSTABLES;
create table migtest_e_enum (
id integer generated by default as identity not null,
@@ -90,7 +90,7 @@ create table migtest_e_history (
id integer generated by default as identity not null,
test_string varchar(255),
constraint pk_migtest_e_history primary key (id)
-);
+) in MAIN index in MAIN long in MAIN;
create table migtest_e_history2 (
id integer generated by default as identity not null,
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 1cc7b4b1d..9ed658aca 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
@@ -87,18 +87,18 @@ create table migtest_mtm_c_migtest_mtm_m (
migtest_mtm_c_id integer not null,
migtest_mtm_m_id bigint not null,
constraint pk_migtest_mtm_c_migtest_mtm_m primary key (migtest_mtm_c_id,migtest_mtm_m_id)
-);
+) in TESTTS index in TESTTS long in TESTTS;
create table migtest_mtm_m_migtest_mtm_c (
migtest_mtm_m_id bigint not null,
migtest_mtm_c_id integer not null,
constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id)
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
create table migtest_mtm_m_phone_numbers (
migtest_mtm_m_id bigint not null,
value varchar(255) not null
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
update migtest_e_basic set status = 'A' where status is null;
@@ -107,6 +107,7 @@ update migtest_e_basic set status = 'A' where status is null;
update migtest_e_basic set status = 'N' where id = 1;
insert into migtest_e_user (id) select distinct user_id from migtest_e_basic;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history2 set test_string = 'unknown' where test_string is null;
@@ -119,6 +120,8 @@ alter table migtest_e_history5 drop versioning;
update migtest_e_history6 set test_number1 = 42 where test_number1 is null;
alter table migtest_e_history6 drop versioning;
alter table "table" drop versioning;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','TESTTS','TESTTS','TESTTS','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','TSMASTER','TSMASTER','TSMASTER','','','','','','MOVE');
-- apply alter tables
alter table "table" add column "select" varchar(255);
alter table migtest_ckey_detail add column one_key integer;
@@ -182,7 +185,7 @@ create unique index uq_migtest_e_basic_status_indextest1 on migtest_e_basic(stat
create unique index uq_migtest_e_basic_name on migtest_e_basic(name) exclude null keys;
create unique index uq_migtest_e_basic_indextest4 on migtest_e_basic(indextest4) exclude null keys;
create unique index uq_migtest_e_basic_indextest5 on migtest_e_basic(indextest5) exclude null keys;
-create table migtest_e_history_history as (select * from migtest_e_history) with no data;
+create table migtest_e_history_history as (select * from migtest_e_history) with no data in MAIN index in MAIN long in MAIN;
alter table migtest_e_history add versioning use history table migtest_e_history_history;
comment on column migtest_e_history.test_string is 'Column altered to long now';
comment on table migtest_e_history is 'We have history now';
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 2fcd77858..545ccdeb4 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
@@ -167,6 +167,8 @@ alter table migtest_e_history6 drop versioning;
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history6 set test_number2 = 7 where test_number2 is null;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- apply alter tables
alter table migtest_e_basic alter column status drop default;
alter table migtest_e_basic alter column status drop not null;
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 69a27f3a5..efd9f0faa 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 @@
--1073246286, 1.0__initial.sql
-2043476851, 1.1.sql
+-2035307143, 1.0__initial.sql
+2129080414, 1.1.sql
364066694, 1.2__dropsFor_1.1.sql
-1155358918, 1.3.sql
+1302478095, 1.3.sql
-1199420632, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
index 578d7cdff..fc3c2054e 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
@@ -77,7 +77,7 @@ create table migtest_e_basic (
constraint ck_mgtst__bsc_stts check ( status in ('N','A','I')),
constraint ck_mgtst__b_z543fg check ( status2 in ('N','A','I')),
constraint pk_migtest_e_basic primary key (id)
-);
+) in TSTABLES index in INDEXTS long in TSTABLES;
create table migtest_e_enum (
id integer generated by default as identity not null,
@@ -90,7 +90,7 @@ create table migtest_e_history (
id integer generated by default as identity not null,
test_string varchar(255),
constraint pk_migtest_e_history primary key (id)
-);
+) in MAIN index in MAIN long in MAIN;
create table migtest_e_history2 (
id integer generated by default as identity not null,
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 21013eea0..82051c0b1 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
@@ -87,18 +87,18 @@ create table migtest_mtm_c_migtest_mtm_m (
migtest_mtm_c_id integer not null,
migtest_mtm_m_id bigint not null,
constraint pk_migtest_mtm_c_migtest_mtm_m primary key (migtest_mtm_c_id,migtest_mtm_m_id)
-);
+) in TESTTS index in TESTTS long in TESTTS;
create table migtest_mtm_m_migtest_mtm_c (
migtest_mtm_m_id bigint not null,
migtest_mtm_c_id integer not null,
constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id)
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
create table migtest_mtm_m_phone_numbers (
migtest_mtm_m_id bigint not null,
value varchar(255) not null
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
update migtest_e_basic set status = 'A' where status is null;
@@ -107,6 +107,7 @@ update migtest_e_basic set status = 'A' where status is null;
update migtest_e_basic set status = 'N' where id = 1;
insert into migtest_e_user (id) select distinct user_id from migtest_e_basic;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history2 set test_string = 'unknown' where test_string is null;
@@ -119,6 +120,8 @@ alter table migtest_e_history5 drop versioning;
update migtest_e_history6 set test_number1 = 42 where test_number1 is null;
alter table migtest_e_history6 drop versioning;
alter table "table" drop versioning;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','TESTTS','TESTTS','TESTTS','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','TSMASTER','TSMASTER','TSMASTER','','','','','','MOVE');
-- apply alter tables
alter table "table" add column "select" varchar(255);
alter table migtest_ckey_detail add column one_key integer;
@@ -182,7 +185,7 @@ create unique index uq_mgtst__b_ucfcne on migtest_e_basic(status,indextest1) exc
create unique index uq_mgtst__bsc_nm on migtest_e_basic(name) exclude null keys;
create unique index uq_mgtst__b_4ayc00 on migtest_e_basic(indextest4) exclude null keys;
create unique index uq_mgtst__b_4ayc01 on migtest_e_basic(indextest5) exclude null keys;
-create table migtest_e_history_history as (select * from migtest_e_history) with no data;
+create table migtest_e_history_history as (select * from migtest_e_history) with no data in MAIN index in MAIN long in MAIN;
alter table migtest_e_history add versioning use history table migtest_e_history_history;
comment on column migtest_e_history.test_string is 'Column altered to long now';
comment on table migtest_e_history is 'We have history now';
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 358d219a8..cdd739792 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
@@ -167,6 +167,8 @@ alter table migtest_e_history6 drop versioning;
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history6 set test_number2 = 7 where test_number2 is null;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- apply alter tables
alter table migtest_e_basic alter column status drop default;
alter table migtest_e_basic alter column status drop not null;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_db2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_db2.migrations
index 880eb4bf6..359f08af9 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_db2.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/idx_db2.migrations
@@ -1,7 +1,7 @@
-2054922533, 1.0__initial.sql
-1256892738, 1.1.sql
+-867624537, 1.0__initial.sql
+-1885896768, 1.1.sql
364066694, 1.2__dropsFor_1.1.sql
-1760988648, 1.3.sql
+-29831669, 1.3.sql
-1199420632, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
index c2235d9c9..8a9d1adeb 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
@@ -77,7 +77,7 @@ create table migtest_e_basic (
constraint ck_migtest_e_basic_status check ( status in ('N','A','I')),
constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I')),
constraint pk_migtest_e_basic primary key (id)
-);
+) in TSTABLES index in INDEXTS long in TSTABLES;
create table migtest_e_enum (
id integer generated by default as identity not null,
@@ -90,7 +90,7 @@ create table migtest_e_history (
id integer generated by default as identity not null,
test_string varchar(255),
constraint pk_migtest_e_history primary key (id)
-);
+) in MAIN index in MAIN long in MAIN;
create table migtest_e_history2 (
id integer generated by default as identity not null,
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 2fb812410..a5d6e0287 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
@@ -87,18 +87,18 @@ create table migtest_mtm_c_migtest_mtm_m (
migtest_mtm_c_id integer not null,
migtest_mtm_m_id bigint not null,
constraint pk_migtest_mtm_c_migtest_mtm_m primary key (migtest_mtm_c_id,migtest_mtm_m_id)
-);
+) in TESTTS index in TESTTS long in TESTTS;
create table migtest_mtm_m_migtest_mtm_c (
migtest_mtm_m_id bigint not null,
migtest_mtm_c_id integer not null,
constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id)
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
create table migtest_mtm_m_phone_numbers (
migtest_mtm_m_id bigint not null,
value varchar(255) not null
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
update migtest_e_basic set status = 'A' where status is null;
@@ -107,6 +107,7 @@ update migtest_e_basic set status = 'A' where status is null;
update migtest_e_basic set status = 'N' where id = 1;
insert into migtest_e_user (id) select distinct user_id from migtest_e_basic;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history2 set test_string = 'unknown' where test_string is null;
@@ -119,6 +120,8 @@ alter table migtest_e_history5 drop versioning;
update migtest_e_history6 set test_number1 = 42 where test_number1 is null;
alter table migtest_e_history6 drop versioning;
alter table "table" drop versioning;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','TESTTS','TESTTS','TESTTS','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','TSMASTER','TSMASTER','TSMASTER','','','','','','MOVE');
-- apply alter tables
alter table "table" add column "select" varchar(255);
alter table migtest_ckey_detail add column one_key integer;
@@ -182,7 +185,7 @@ create unique index uq_migtest_e_basic_status_indextest1 on migtest_e_basic(stat
create unique index uq_migtest_e_basic_name on migtest_e_basic(name) exclude null keys;
create unique index uq_migtest_e_basic_indextest4 on migtest_e_basic(indextest4) exclude null keys;
create unique index uq_migtest_e_basic_indextest5 on migtest_e_basic(indextest5) exclude null keys;
-create table migtest_e_history_history as (select * from migtest_e_history) with no data;
+create table migtest_e_history_history as (select * from migtest_e_history) with no data in MAIN index in MAIN long in MAIN;
alter table migtest_e_history add versioning use history table migtest_e_history_history;
comment on column migtest_e_history.test_string is 'Column altered to long now';
comment on table migtest_e_history is 'We have history now';
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 9dbb719d6..b5d82e860 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
@@ -167,6 +167,8 @@ alter table migtest_e_history6 drop versioning;
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history6 set test_number2 = 7 where test_number2 is null;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- apply alter tables
alter table migtest_e_basic alter column status drop default;
alter table migtest_e_basic alter column status drop not null;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/I__create_tablespaces.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/I__create_tablespaces.sql
new file mode 100644
index 000000000..84692a31d
--- /dev/null
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/I__create_tablespaces.sql
@@ -0,0 +1,36 @@
+
+delimiter $$
+BEGIN
+IF (NOT exists (SELECT * FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE = 'TSTABLES')) THEN
+EXECUTE IMMEDIATE 'CREATE TABLESPACE "TSTABLES"';
+END IF;
+END
+$$
+delimiter $$
+BEGIN
+IF (NOT exists (SELECT * FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE = 'INDEXTS'))
+THEN EXECUTE IMMEDIATE 'CREATE TABLESPACE "INDEXTS"';
+END IF;
+END
+$$
+delimiter $$
+BEGIN
+IF (NOT exists (SELECT * FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE = 'TESTTS')) THEN
+EXECUTE IMMEDIATE 'CREATE TABLESPACE "TESTTS"';
+END IF;
+END
+$$
+delimiter $$
+BEGIN
+IF (NOT exists (SELECT * FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE = 'TSMASTER')) THEN
+EXECUTE IMMEDIATE 'CREATE TABLESPACE "TSMASTER"';
+END IF;
+END
+$$
+delimiter $$
+BEGIN
+IF (NOT exists (SELECT * FROM SYSIBM.SYSTABLESPACES WHERE TBSPACE = 'MAIN')) THEN
+EXECUTE IMMEDIATE 'CREATE TABLESPACE "MAIN"';
+END IF;
+END
+$$
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 9d4b61aa7..27ba5f2fc 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,7 +1,8 @@
--1519091511, 1.0__initial.sql
--370964456, 1.1.sql
+1307787475, I__create_tablespaces.sql
+-1520031543, 1.0__initial.sql
+1233890256, 1.1.sql
364066694, 1.2__dropsFor_1.1.sql
-591329540, 1.3.sql
+-1775325396, 1.3.sql
-1199420632, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
index c2235d9c9..8a9d1adeb 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
@@ -77,7 +77,7 @@ create table migtest_e_basic (
constraint ck_migtest_e_basic_status check ( status in ('N','A','I')),
constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I')),
constraint pk_migtest_e_basic primary key (id)
-);
+) in TSTABLES index in INDEXTS long in TSTABLES;
create table migtest_e_enum (
id integer generated by default as identity not null,
@@ -90,7 +90,7 @@ create table migtest_e_history (
id integer generated by default as identity not null,
test_string varchar(255),
constraint pk_migtest_e_history primary key (id)
-);
+) in MAIN index in MAIN long in MAIN;
create table migtest_e_history2 (
id integer generated by default as identity not null,
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 2fb812410..a5d6e0287 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
@@ -87,18 +87,18 @@ create table migtest_mtm_c_migtest_mtm_m (
migtest_mtm_c_id integer not null,
migtest_mtm_m_id bigint not null,
constraint pk_migtest_mtm_c_migtest_mtm_m primary key (migtest_mtm_c_id,migtest_mtm_m_id)
-);
+) in TESTTS index in TESTTS long in TESTTS;
create table migtest_mtm_m_migtest_mtm_c (
migtest_mtm_m_id bigint not null,
migtest_mtm_c_id integer not null,
constraint pk_migtest_mtm_m_migtest_mtm_c primary key (migtest_mtm_m_id,migtest_mtm_c_id)
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
create table migtest_mtm_m_phone_numbers (
migtest_mtm_m_id bigint not null,
value varchar(255) not null
-);
+) in TSMASTER index in TSMASTER long in TSMASTER;
update migtest_e_basic set status = 'A' where status is null;
@@ -107,6 +107,7 @@ update migtest_e_basic set status = 'A' where status is null;
update migtest_e_basic set status = 'N' where id = 1;
insert into migtest_e_user (id) select distinct user_id from migtest_e_basic;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history2 set test_string = 'unknown' where test_string is null;
@@ -119,6 +120,8 @@ alter table migtest_e_history5 drop versioning;
update migtest_e_history6 set test_number1 = 42 where test_number1 is null;
alter table migtest_e_history6 drop versioning;
alter table "table" drop versioning;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','TESTTS','TESTTS','TESTTS','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','TSMASTER','TSMASTER','TSMASTER','','','','','','MOVE');
-- apply alter tables
alter table "table" add column "select" varchar(255);
alter table migtest_ckey_detail add column one_key integer;
@@ -182,7 +185,7 @@ create unique index uq_migtest_e_basic_status_indextest1 on migtest_e_basic(stat
create unique index uq_migtest_e_basic_name on migtest_e_basic(name) exclude null keys;
create unique index uq_migtest_e_basic_indextest4 on migtest_e_basic(indextest4) exclude null keys;
create unique index uq_migtest_e_basic_indextest5 on migtest_e_basic(indextest5) exclude null keys;
-create table migtest_e_history_history as (select * from migtest_e_history) with no data;
+create table migtest_e_history_history as (select * from migtest_e_history) with no data in MAIN index in MAIN long in MAIN;
alter table migtest_e_history add versioning use history table migtest_e_history_history;
comment on column migtest_e_history.test_string is 'Column altered to long now';
comment on table migtest_e_history is 'We have history now';
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 9dbb719d6..b5d82e860 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
@@ -167,6 +167,8 @@ alter table migtest_e_history6 drop versioning;
-- NOTE: table has @History - special migration may be necessary
update migtest_e_history6 set test_number2 = 7 where test_number2 is null;
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_C','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
+CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_MTM_M','USERSPACE1','USERSPACE1','USERSPACE1','','','','','','MOVE');
-- apply alter tables
alter table migtest_e_basic alter column status drop default;
alter table migtest_e_basic alter column status drop not null;
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 9d4b61aa7..cb4a3dfc1 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 @@
--1519091511, 1.0__initial.sql
--370964456, 1.1.sql
+-1520031543, 1.0__initial.sql
+1233890256, 1.1.sql
364066694, 1.2__dropsFor_1.1.sql
-591329540, 1.3.sql
+-1775325396, 1.3.sql
-1199420632, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
index 001f3797f..082c9bd3a 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
@@ -37,7 +37,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
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 410615793..2b7b577e3 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
@@ -47,6 +47,7 @@
+
@@ -79,19 +80,21 @@
-
+
+
-
+
+
-
+
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 1c266ccae..1609ed17f 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
@@ -41,6 +41,8 @@
+
+
diff --git a/ebean-test/testconfig/ebean-db2.properties b/ebean-test/testconfig/ebean-db2.properties
index 40e375ef5..4ffab60f1 100644
--- a/ebean-test/testconfig/ebean-db2.properties
+++ b/ebean-test/testconfig/ebean-db2.properties
@@ -1,5 +1,7 @@
ebean.test.platform=db2
ebean.test.dbName=unit
-ebean.test.dbPassword=unit
+# we need admin user to call the procedure SYSPROC.ADMIN_MOVE_TABLE
+ebean.test.username=admin
+ebean.test.password=admin
datasource.default=db2-11
ebean.db2-11.databasePlatformName=db2luw