mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Reference scripts
This commit is contained in:
@@ -5,13 +5,15 @@ create table migtest_e_history7 (
|
||||
constraint pk_migtest_e_history7 primary key (id)
|
||||
);
|
||||
|
||||
-- apply alter tables
|
||||
alter table migtest_e_history7 add column sys_period_start timestamp default now();
|
||||
alter table migtest_e_history7 add column sys_period_end timestamp;
|
||||
-- apply post alter
|
||||
create table migtest_e_history7_history(
|
||||
id integer,
|
||||
sys_period_start timestamp,
|
||||
sys_period_end timestamp
|
||||
);
|
||||
create view migtest_e_history7_with_history as select * from migtest_e_history7 union all select * from migtest_e_history7_history;
|
||||
|
||||
create trigger migtest_e_history7_history_upd before update,delete on migtest_e_history7 for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
|
||||
|
||||
|
||||
+3
-4
@@ -2,9 +2,8 @@
|
||||
-- drop dependencies
|
||||
drop trigger migtest_e_history7_history_upd;
|
||||
drop view migtest_e_history7_with_history;
|
||||
alter table migtest_e_history7 drop column sys_period_start;
|
||||
alter table migtest_e_history7 drop column sys_period_end;
|
||||
drop table migtest_e_history7_history;
|
||||
|
||||
|
||||
-- apply changes
|
||||
-- apply alter tables
|
||||
alter table migtest_e_history7 drop column sys_period_start;
|
||||
alter table migtest_e_history7 drop column sys_period_end;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
-1073246286, 1.0__initial.sql
|
||||
2043476851, 1.1.sql
|
||||
305924563, 1.0__initial.sql
|
||||
125684563, 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
|
||||
-133543359, R__db2_explain_tables.sql
|
||||
561281075, R__order_views.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;
|
||||
|
||||
+4
-3
@@ -1,7 +1,8 @@
|
||||
2054922533, 1.0__initial.sql
|
||||
1256892738, 1.1.sql
|
||||
-1962818378, 1.0__initial.sql
|
||||
-1558090526, 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
|
||||
-133543359, R__db2_explain_tables.sql
|
||||
561281075, R__order_views.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;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
-1519091511, 1.0__initial.sql
|
||||
-370964456, 1.1.sql
|
||||
-1602289007, I__create_tablespaces.sql
|
||||
-295943649, 1.0__initial.sql
|
||||
1539839817, 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
|
||||
-133543359, R__db2_explain_tables.sql
|
||||
561281075, R__order_views.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;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
-1519091511, 1.0__initial.sql
|
||||
-370964456, 1.1.sql
|
||||
-295943649, 1.0__initial.sql
|
||||
1539839817, 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
|
||||
-133543359, R__db2_explain_tables.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<uniqueConstraint name="uq_migtest_e_ref_name" columnNames="name" oneToOne="false" nullableColumns=""/>
|
||||
</createTable>
|
||||
<alterColumn columnName=""index"" tableName=""table"" withHistory="true" comment="this is a comment"/>
|
||||
<alterTable name="migtest_mtm_c" tablespace="$TABLESPACE_DEFAULT" indexTablespace="$TABLESPACE_DEFAULT" lobTablespace="$TABLESPACE_DEFAULT"/>
|
||||
<alterTable name="migtest_mtm_m" tablespace="$TABLESPACE_DEFAULT" indexTablespace="$TABLESPACE_DEFAULT" lobTablespace="$TABLESPACE_DEFAULT"/>
|
||||
<addUniqueConstraint constraintName="uq_m12_otoc72" tableName="migtest_oto_child" columnNames="name" oneToOne="false" nullableColumns="name" platforms="MYSQL"/>
|
||||
<addUniqueConstraint constraintName="uq_migtest_oto_master_name" tableName="migtest_oto_master" columnNames="name" oneToOne="false" nullableColumns="name" platforms="MYSQL"/>
|
||||
<createIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic" columns="indextest1"/>
|
||||
|
||||
Reference in New Issue
Block a user