mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Generate failing migration
This commit is contained in:
@@ -24,6 +24,11 @@ create table drop_ref_one (
|
||||
parent_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id UInt32,
|
||||
parent_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id UInt32,
|
||||
test_byte16 String,
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
193400547, 1.0__initial.sql
|
||||
1036221356, 1.1.sql
|
||||
-1021430823, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
1015552567, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
1436420661, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 bytea,
|
||||
@@ -217,6 +224,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one cascade;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary cascade;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json cascade;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
1434934404, 1.0__initial.sql
|
||||
-1445091875, 1.1.sql
|
||||
-645855838, 1.1.sql
|
||||
856096334, 1.2__dropsFor_1.1.sql
|
||||
-279468991, 1.3.sql
|
||||
-1398154763, 1.4__dropsFor_1.3.sql
|
||||
-1416035730, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -107,6 +107,12 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -306,6 +312,7 @@ alter table table_history add column "select" varchar(255);
|
||||
alter table table_history add column textfield2 varchar(255);
|
||||
call sysproc.admin_cmd('reorg table table_history');
|
||||
-- apply post alter
|
||||
create unique index uq_drop_ref_one_to_one_parent_id on drop_ref_one_to_one(parent_id) exclude null keys;
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
|
||||
create unique index uq_migtest_e_basic_description on migtest_e_basic(description) exclude null keys;
|
||||
update migtest_e_basic set new_boolean_field = old_boolean;
|
||||
@@ -337,6 +344,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -73,6 +73,14 @@ if exists (select seqschema from syscat.sequences where seqschema = current_sche
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one_to_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_TO_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_to_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-1467839063, 1.0__initial.sql
|
||||
1392865974, 1.1.sql
|
||||
638526085, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
-1811865535, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
2087595324, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -220,6 +227,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
-1547037623, 1.0__initial.sql
|
||||
275373095, 1.1.sql
|
||||
563570833, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
674925120, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
1436420661, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -107,6 +107,12 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -306,6 +312,7 @@ alter table table_history add column "select" varchar(255);
|
||||
alter table table_history add column textfield2 varchar(255);
|
||||
call sysproc.admin_cmd('reorg table table_history');
|
||||
-- apply post alter
|
||||
create unique index uq_drop_ref_one_to_one_parent_id on drop_ref_one_to_one(parent_id) exclude null keys;
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
|
||||
create unique index uq_migtest_e_basic_description on migtest_e_basic(description) exclude null keys;
|
||||
update migtest_e_basic set new_boolean_field = old_boolean;
|
||||
@@ -337,6 +344,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -73,6 +73,14 @@ if exists (select seqschema from syscat.sequences where seqschema = current_sche
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one_to_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_TO_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_to_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
1307787475, I__create_tablespaces.sql
|
||||
2058232717, 1.0__initial.sql
|
||||
372361421, 1.1.sql
|
||||
-1168453954, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
469192394, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
2087595324, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -107,6 +107,12 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -306,6 +312,7 @@ alter table table_history add column "select" varchar(255);
|
||||
alter table table_history add column textfield2 varchar(255);
|
||||
call sysproc.admin_cmd('reorg table table_history');
|
||||
-- apply post alter
|
||||
create unique index uq_drop_ref_one_to_one_parent_id on drop_ref_one_to_one(parent_id) exclude null keys;
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
|
||||
create unique index uq_migtest_e_basic_description on migtest_e_basic(description) exclude null keys;
|
||||
update migtest_e_basic set new_boolean_field = old_boolean;
|
||||
@@ -337,6 +344,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -73,6 +73,14 @@ if exists (select seqschema from syscat.sequences where seqschema = current_sche
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one_to_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_TO_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_to_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
2058232717, 1.0__initial.sql
|
||||
372361421, 1.1.sql
|
||||
-1168453954, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
469192394, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
2087595324, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -220,6 +227,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
-1547037623, 1.0__initial.sql
|
||||
275373095, 1.1.sql
|
||||
563570833, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
674925120, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
1436420661, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -264,6 +271,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ drop table if exists drop_ref_many;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-1854589550, 1.0__initial.sql
|
||||
-505431855, 1.1.sql
|
||||
768680300, 1.1.sql
|
||||
1579867974, 1.2__dropsFor_1.1.sql
|
||||
64466326, 1.3.sql
|
||||
-232694612, 1.4__dropsFor_1.3.sql
|
||||
334448611, 1.4__dropsFor_1.3.sql
|
||||
783227075, R__multi_comments.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -81,6 +81,13 @@ create column table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create column table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create column table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -295,6 +302,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
-- explicit index "ix_drop_ref_one_parent_id" for single column "parent_id" of table "drop_ref_one" is not necessary;
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
-- explicit index "ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c" for single column "migtest_mtm_c_id" of table "migtest_mtm_c_migtest_mtm_m" is not necessary;
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ drop table drop_main cascade;
|
||||
drop table drop_main_drop_ref_many cascade;
|
||||
drop table drop_ref_many cascade;
|
||||
drop table drop_ref_one cascade;
|
||||
drop table drop_ref_one_to_one cascade;
|
||||
drop table migtest_e_test_binary cascade;
|
||||
drop table migtest_e_test_json cascade;
|
||||
drop table migtest_e_test_lob cascade;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-745347271, I__create_procs.sql
|
||||
-2017770851, 1.0__initial.sql
|
||||
2126049978, 1.1.sql
|
||||
-475843596, 1.1.sql
|
||||
1535221752, 1.2__dropsFor_1.1.sql
|
||||
1459381570, 1.3.sql
|
||||
-490709749, 1.4__dropsFor_1.3.sql
|
||||
1613562845, 1.4__dropsFor_1.3.sql
|
||||
1906063401, R__order_views_hana.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -220,6 +227,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ drop table if exists drop_ref_many;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
1833930558, 1.0__initial.sql
|
||||
-432003541, 1.1.sql
|
||||
277065890, 1.1.sql
|
||||
-848622216, 1.2__dropsFor_1.1.sql
|
||||
-1921508585, 1.3.sql
|
||||
-1547659386, 1.4__dropsFor_1.3.sql
|
||||
-1765256531, 1.4__dropsFor_1.3.sql
|
||||
861001272, R__order_views_hsqldb.sql
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -209,6 +216,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
+2
@@ -27,6 +27,8 @@ drop table if exists drop_ref_many;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
-2111548334, 1.0__initial.sql
|
||||
1717242095, 1.1.sql
|
||||
1085383251, 1.1.sql
|
||||
919151678, 1.2__dropsFor_1.1.sql
|
||||
-413458006, 1.3.sql
|
||||
-177212756, 1.4__dropsFor_1.3.sql
|
||||
-924292968, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -209,6 +216,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ drop table if exists drop_ref_many;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
-1933396282, I__create_procs.sql
|
||||
-2111548334, 1.0__initial.sql
|
||||
1717242095, 1.1.sql
|
||||
1085383251, 1.1.sql
|
||||
1187950993, 1.2__dropsFor_1.1.sql
|
||||
-413458006, 1.3.sql
|
||||
-1494509099, 1.4__dropsFor_1.3.sql
|
||||
-298825700, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="parent_id" type="integer" references="drop_main.id" foreignKeyName="fk_drop_ref_one_parent_id" foreignKeyIndex="ix_drop_ref_one_parent_id"/>
|
||||
</createTable>
|
||||
<createTable name="drop_ref_one_to_one" pkName="pk_drop_ref_one_to_one">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="parent_id" type="integer" uniqueOneToOne="uq_drop_ref_one_to_one_parent_id" references="drop_main.id" foreignKeyName="fk_drop_ref_one_to_one_parent_id"/>
|
||||
</createTable>
|
||||
<alterColumn columnName="status" tableName="migtest_e_basic" currentType="varchar(1)" defaultValue="'A'" notnull="true" currentNotnull="false" checkConstraint="check ( status in ('N','A','I','?'))" checkConstraintName="ck_migtest_e_basic_status"/>
|
||||
<alterColumn columnName="status2" tableName="migtest_e_basic" type="varchar(127)" currentType="varchar(1)" defaultValue="DROP DEFAULT" notnull="false" currentNotnull="true" dropCheckConstraint="ck_migtest_e_basic_status2"/>
|
||||
<alterColumn columnName="description" tableName="migtest_e_basic" unique="uq_migtest_e_basic_description">
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
<dropTable name="drop_main_drop_ref_many"/>
|
||||
<dropTable name="drop_ref_many" sequenceCol="id"/>
|
||||
<dropTable name="drop_ref_one" sequenceCol="id"/>
|
||||
<dropTable name="drop_ref_one_to_one" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_binary" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_json" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_lob" sequenceCol="id"/>
|
||||
|
||||
+1
@@ -22,6 +22,7 @@
|
||||
<dropTable name="drop_main_drop_ref_many"/>
|
||||
<dropTable name="drop_ref_many" sequenceCol="id"/>
|
||||
<dropTable name="drop_ref_one" sequenceCol="id"/>
|
||||
<dropTable name="drop_ref_one_to_one" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_binary" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_json" sequenceCol="id"/>
|
||||
<dropTable name="migtest_e_test_lob" sequenceCol="id"/>
|
||||
|
||||
@@ -30,6 +30,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -327,6 +334,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-1933396282, I__create_procs.sql
|
||||
1980830787, 1.0__initial.sql
|
||||
-847541300, 1.1.sql
|
||||
-151422898, 1.1.sql
|
||||
-1097227916, 1.2__dropsFor_1.1.sql
|
||||
141196883, 1.3.sql
|
||||
1044119359, 1.4__dropsFor_1.3.sql
|
||||
261977585, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -327,6 +334,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
-1933396282, I__create_procs.sql
|
||||
369577572, 1.0__initial.sql
|
||||
-847541300, 1.1.sql
|
||||
-151422898, 1.1.sql
|
||||
-1097227916, 1.2__dropsFor_1.1.sql
|
||||
141196883, 1.3.sql
|
||||
1044119359, 1.4__dropsFor_1.3.sql
|
||||
261977585, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -351,6 +358,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id);
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ drop table if exists drop_ref_many;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
390216918, 1.0__initial.sql
|
||||
-303196611, 1.1.sql
|
||||
-1064172809, 1.1.sql
|
||||
1530685455, 1.2__dropsFor_1.1.sql
|
||||
-956168377, 1.3.sql
|
||||
1047623430, 1.4__dropsFor_1.3.sql
|
||||
-381446847, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -78,6 +78,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id number(10) generated by default as identity not null,
|
||||
parent_id number(10),
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id number(10) generated by default as identity not null,
|
||||
test_byte16 raw(16),
|
||||
@@ -265,6 +272,8 @@ alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joesl
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drp_rf_n_t_n_prnt_d foreign key (parent_id) references drop_main (id);
|
||||
|
||||
create index ix_mgtst_mtm_c_mgtst_mt_3ug4ok on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_mgtst_mtm_c_mgtst_mt_93awga foreign key (migtest_mtm_c_id) references migtest_mtm_c (id);
|
||||
|
||||
|
||||
@@ -51,6 +51,17 @@ exception
|
||||
when expected_error then null;
|
||||
end;
|
||||
$$;
|
||||
drop table drop_ref_one_to_one cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
expected_error exception;
|
||||
pragma exception_init(expected_error, -2289);
|
||||
begin
|
||||
execute immediate 'drop sequence drop_ref_one_to_one_seq';
|
||||
exception
|
||||
when expected_error then null;
|
||||
end;
|
||||
$$;
|
||||
drop table migtest_e_test_binary cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
1757923548, 1.0__initial.sql
|
||||
-1862781653, 1.1.sql
|
||||
-130678137, 1.1.sql
|
||||
930172034, 1.2__dropsFor_1.1.sql
|
||||
-647790612, 1.3.sql
|
||||
-116456403, 1.4__dropsFor_1.3.sql
|
||||
1480920634, 1.4__dropsFor_1.3.sql
|
||||
1357801733, R__oracle_only_views.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -81,6 +81,14 @@ create table drop_ref_one (
|
||||
);
|
||||
create sequence drop_ref_one_seq;
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id number(10) not null,
|
||||
parent_id number(10),
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
create sequence drop_ref_one_to_one_seq;
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id number(10) not null,
|
||||
test_byte16 raw(16),
|
||||
@@ -273,6 +281,8 @@ alter table drop_main_drop_ref_many add constraint fk_drp_mn_drp_rf_mny_dr_joesl
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drp_rf_n_t_n_prnt_d foreign key (parent_id) references drop_main (id);
|
||||
|
||||
create index ix_mgtst_mtm_c_mgtst_mt_3ug4ok on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_mgtst_mtm_c_mgtst_mt_93awga foreign key (migtest_mtm_c_id) references migtest_mtm_c (id);
|
||||
|
||||
|
||||
+11
@@ -51,6 +51,17 @@ exception
|
||||
when expected_error then null;
|
||||
end;
|
||||
$$;
|
||||
drop table drop_ref_one_to_one cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
expected_error exception;
|
||||
pragma exception_init(expected_error, -2289);
|
||||
begin
|
||||
execute immediate 'drop sequence drop_ref_one_to_one_seq';
|
||||
exception
|
||||
when expected_error then null;
|
||||
end;
|
||||
$$;
|
||||
drop table migtest_e_test_binary cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
-1422254768, 1.0__initial.sql
|
||||
661141209, 1.1.sql
|
||||
1418539051, 1.1.sql
|
||||
930172034, 1.2__dropsFor_1.1.sql
|
||||
1369863782, 1.3.sql
|
||||
-116456403, 1.4__dropsFor_1.3.sql
|
||||
1480920634, 1.4__dropsFor_1.3.sql
|
||||
1357801733, R__oracle_only_views.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -36,6 +36,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 bytea,
|
||||
@@ -422,6 +429,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one cascade;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary cascade;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json cascade;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
1942370812, 1.0__initial.sql
|
||||
-150823045, 1.1.sql
|
||||
-1945546744, 1.1.sql
|
||||
-261111052, 1.2__dropsFor_1.1.sql
|
||||
788727457, 1.3.sql
|
||||
-1352224731, 1.4__dropsFor_1.3.sql
|
||||
1188958800, 1.4__dropsFor_1.3.sql
|
||||
783227075, R__multi_comments.sql
|
||||
561281075, R__order_views.sql
|
||||
283077354, R__pg_indexes.sql
|
||||
|
||||
@@ -36,6 +36,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id serial not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id serial not null,
|
||||
test_byte16 bytea,
|
||||
@@ -422,6 +429,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
+2
@@ -120,6 +120,8 @@ drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one cascade;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary cascade;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json cascade;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
-1015076364, 1.0__initial.sql
|
||||
328269371, 1.1.sql
|
||||
-1624208025, 1.1.sql
|
||||
-261111052, 1.2__dropsFor_1.1.sql
|
||||
-1811829200, 1.3.sql
|
||||
-1352224731, 1.4__dropsFor_1.3.sql
|
||||
1188958800, 1.4__dropsFor_1.3.sql
|
||||
783227075, R__multi_comments.sql
|
||||
561281075, R__order_views.sql
|
||||
283077354, R__pg_indexes.sql
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -220,6 +227,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
-391639901, 1.0__initial.sql
|
||||
974884972, 1.1.sql
|
||||
1808590378, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
1199670482, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
1436420661, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -36,6 +36,14 @@ create table drop_ref_one (
|
||||
foreign key (parent_id) references drop_main (id) on delete restrict on update restrict
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id),
|
||||
foreign key (parent_id) references drop_main (id) on delete restrict on update restrict
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer not null,
|
||||
test_byte16 varbinary(16),
|
||||
|
||||
@@ -21,6 +21,7 @@ drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists drop_ref_one_to_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
-1527127682, 1.0__initial.sql
|
||||
-321125092, 1.1.sql
|
||||
728006469, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
142780650, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
1436420661, 1.4__dropsFor_1.3.sql
|
||||
2034589659, R__order_views_sqlite.sql
|
||||
|
||||
|
||||
@@ -35,6 +35,12 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer identity(1,1) not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer identity(1,1) not null,
|
||||
test_byte16 image,
|
||||
@@ -219,6 +225,7 @@ alter table migtest_e_history6 alter column test_number2 integer;
|
||||
alter table migtest_e_softdelete add deleted bit default 0 not null;
|
||||
alter table migtest_oto_child add master_id bigint;
|
||||
-- apply post alter
|
||||
create unique nonclustered index uq_drop_ref_one_to_one_parent_id on drop_ref_one_to_one(parent_id) where parent_id is not null;
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
|
||||
create unique nonclustered index uq_migtest_e_basic_description on migtest_e_basic(description) where description is not null;
|
||||
update migtest_e_basic set new_boolean_field = old_boolean;
|
||||
@@ -244,6 +251,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id);
|
||||
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many;
|
||||
IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq;
|
||||
IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one;
|
||||
IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq;
|
||||
IF OBJECT_ID('drop_ref_one_to_one', 'U') IS NOT NULL drop table drop_ref_one_to_one;
|
||||
IF OBJECT_ID('drop_ref_one_to_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_to_one_seq;
|
||||
IF OBJECT_ID('migtest_e_test_binary', 'U') IS NOT NULL drop table migtest_e_test_binary;
|
||||
IF OBJECT_ID('migtest_e_test_binary_seq', 'SO') IS NOT NULL drop sequence migtest_e_test_binary_seq;
|
||||
IF OBJECT_ID('migtest_e_test_json', 'U') IS NOT NULL drop table migtest_e_test_json;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
891357544, I__create_procs.sql
|
||||
-1455820494, 1.0__initial.sql
|
||||
-88313995, 1.1.sql
|
||||
-2020672101, 1.1.sql
|
||||
-1431095657, 1.2__dropsFor_1.1.sql
|
||||
1846195516, 1.3.sql
|
||||
-225579996, 1.4__dropsFor_1.3.sql
|
||||
-1281693740, 1.4__dropsFor_1.3.sql
|
||||
1607822082, R__order_views_mssql.sql
|
||||
|
||||
|
||||
@@ -38,6 +38,13 @@ create table drop_ref_one (
|
||||
);
|
||||
create sequence drop_ref_one_seq as bigint start with 1;
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
create sequence drop_ref_one_to_one_seq as bigint start with 1;
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer not null,
|
||||
test_byte16 varbinary(16),
|
||||
@@ -227,6 +234,7 @@ alter table migtest_e_history6 alter column test_number2 integer;
|
||||
alter table migtest_e_softdelete add deleted bit default 0 not null;
|
||||
alter table migtest_oto_child add master_id bigint;
|
||||
-- apply post alter
|
||||
create unique nonclustered index uq_drop_ref_one_to_one_parent_id on drop_ref_one_to_one(parent_id) where parent_id is not null;
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
|
||||
create unique nonclustered index uq_migtest_e_basic_description on migtest_e_basic(description) where description is not null;
|
||||
update migtest_e_basic set new_boolean_field = old_boolean;
|
||||
@@ -252,6 +260,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id);
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id);
|
||||
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ IF OBJECT_ID('drop_ref_many', 'U') IS NOT NULL drop table drop_ref_many;
|
||||
IF OBJECT_ID('drop_ref_many_seq', 'SO') IS NOT NULL drop sequence drop_ref_many_seq;
|
||||
IF OBJECT_ID('drop_ref_one', 'U') IS NOT NULL drop table drop_ref_one;
|
||||
IF OBJECT_ID('drop_ref_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_seq;
|
||||
IF OBJECT_ID('drop_ref_one_to_one', 'U') IS NOT NULL drop table drop_ref_one_to_one;
|
||||
IF OBJECT_ID('drop_ref_one_to_one_seq', 'SO') IS NOT NULL drop sequence drop_ref_one_to_one_seq;
|
||||
IF OBJECT_ID('migtest_e_test_binary', 'U') IS NOT NULL drop table migtest_e_test_binary;
|
||||
IF OBJECT_ID('migtest_e_test_binary_seq', 'SO') IS NOT NULL drop sequence migtest_e_test_binary_seq;
|
||||
IF OBJECT_ID('migtest_e_test_json', 'U') IS NOT NULL drop table migtest_e_test_json;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
891357544, I__create_procs.sql
|
||||
1574627056, 1.0__initial.sql
|
||||
1681608861, 1.1.sql
|
||||
1141454658, 1.1.sql
|
||||
-1431095657, 1.2__dropsFor_1.1.sql
|
||||
486442698, 1.3.sql
|
||||
-225579996, 1.4__dropsFor_1.3.sql
|
||||
-1281693740, 1.4__dropsFor_1.3.sql
|
||||
1607822082, R__order_views_mssql.sql
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ create table drop_ref_one (
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one_to_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint uq_drop_ref_one_to_one_parent_id unique (parent_id),
|
||||
constraint pk_drop_ref_one_to_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 bytea,
|
||||
@@ -421,6 +428,8 @@ alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_dr
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
alter table drop_ref_one_to_one add constraint fk_drop_ref_one_to_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists drop_ref_one_to_one cascade;
|
||||
drop sequence if exists drop_ref_one_to_one_seq;
|
||||
drop table if exists migtest_e_test_binary cascade;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json cascade;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
-1646972843, 1.0__initial.sql
|
||||
1912842724, 1.1.sql
|
||||
-698093883, 1.1.sql
|
||||
-261111052, 1.2__dropsFor_1.1.sql
|
||||
-526466104, 1.3.sql
|
||||
-1352224731, 1.4__dropsFor_1.3.sql
|
||||
1188958800, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
Reference in New Issue
Block a user