diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.db2.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.db2.drop.cmmn.sql new file mode 100644 index 00000000000..59c1625d759 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.db2.drop.cmmn.sql @@ -0,0 +1,38 @@ +alter table ACT_CMMN_RU_MIL_INST drop foreign key ACT_FK_MIL_CASE_INST; +alter table ACT_CMMN_RU_MIL_INST drop foreign key ACT_FK_MIL_CASE_DEF; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_PLAN_ITEM; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_CASE_INST; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_CASE_DEF; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop foreign key ACT_FK_PLAN_ITEM_CASE_INST; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop foreign key ACT_FK_PLAN_ITEM_CASE_DEF; +alter table ACT_CMMN_RU_CASE_INST drop foreign key ACT_FK_CASE_INST_CASE_DEF; +alter table ACT_CMMN_CASEDEF drop foreign key ACT_FK_CASE_DEF_DPLY; +alter table ACT_CMMN_DEPLOYMENT_RESOURCE drop foreign key ACT_FK_CMMN_RSRC_DPL; + +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index ACT_IDX_CASE_INST_REF_ID_; +drop index ACT_IDX_CASE_DEF_UNIQ; +drop index ACT_IDX_PLAN_ITEM_STAGE_INST; +drop index ACT_IDX_MIL_CASE_INST; +drop index ACT_IDX_MIL_CASE_DEF; +drop index ACT_IDX_SENTRY_PLAN_ITEM; +drop index ACT_IDX_SENTRY_CASE_INST; +drop index ACT_IDX_SENTRY_CASE_DEF; +drop index ACT_IDX_PLAN_ITEM_CASE_INST; +drop index ACT_IDX_PLAN_ITEM_CASE_DEF; +drop index ACT_IDX_CASE_INST_PARENT; +drop index ACT_IDX_CASE_INST_CASE_DEF; +drop index ACT_IDX_CASE_DEF_DPLY; +drop index ACT_IDX_CMMN_RSRC_DPL; + +drop table ACT_CMMN_HI_PLAN_ITEM_INST; +drop table ACT_CMMN_HI_MIL_INST; +drop table ACT_CMMN_HI_CASE_INST; +drop table ACT_CMMN_RU_MIL_INST; +drop table ACT_CMMN_RU_SENTRY_PART_INST; +drop table ACT_CMMN_RU_PLAN_ITEM_INST; +drop table ACT_CMMN_RU_CASE_INST; +drop table ACT_CMMN_CASEDEF; +drop table ACT_CMMN_DEPLOYMENT_RESOURCE; +drop table ACT_CMMN_DEPLOYMENT; \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.h2.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.h2.drop.cmmn.sql new file mode 100644 index 00000000000..a552a9d966b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.h2.drop.cmmn.sql @@ -0,0 +1,27 @@ +drop table if exists ACT_CMMN_HI_PLAN_ITEM_INST cascade constraints; +drop table if exists ACT_CMMN_HI_MIL_INST cascade constraints; +drop table if exists ACT_CMMN_HI_CASE_INST cascade constraints; +drop table if exists ACT_CMMN_RU_MIL_INST cascade constraints; +drop table if exists ACT_CMMN_RU_SENTRY_PART_INST cascade constraints; +drop table if exists ACT_CMMN_RU_PLAN_ITEM_INST cascade constraints; +drop table if exists ACT_CMMN_RU_CASE_INST cascade constraints; +drop table if exists ACT_CMMN_CASEDEF cascade constraints; +drop table if exists ACT_CMMN_DEPLOYMENT_RESOURCE cascade constraints; +drop table if exists ACT_CMMN_DEPLOYMENT cascade constraints; + +drop index if exists ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index if exists ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index if exists ACT_IDX_CASE_INST_REF_ID_; +drop index if exists ACT_IDX_CASE_DEF_UNIQ; +drop index if exists ACT_IDX_PLAN_ITEM_STAGE_INST; +drop index if exists ACT_IDX_MIL_CASE_INST; +drop index if exists ACT_IDX_MIL_CASE_DEF; +drop index if exists ACT_IDX_SENTRY_PLAN_ITEM; +drop index if exists ACT_IDX_SENTRY_CASE_INST; +drop index if exists ACT_IDX_SENTRY_CASE_DEF; +drop index if exists ACT_IDX_PLAN_ITEM_CASE_INST; +drop index if exists ACT_IDX_PLAN_ITEM_CASE_DEF; +drop index if exists ACT_IDX_CASE_INST_PARENT; +drop index if exists ACT_IDX_CASE_INST_CASE_DEF; +drop index if exists ACT_IDX_CASE_DEF_DPLY; +drop index if exists ACT_IDX_CMMN_RSRC_DPL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.hsql.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.hsql.drop.cmmn.sql new file mode 100644 index 00000000000..a552a9d966b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.hsql.drop.cmmn.sql @@ -0,0 +1,27 @@ +drop table if exists ACT_CMMN_HI_PLAN_ITEM_INST cascade constraints; +drop table if exists ACT_CMMN_HI_MIL_INST cascade constraints; +drop table if exists ACT_CMMN_HI_CASE_INST cascade constraints; +drop table if exists ACT_CMMN_RU_MIL_INST cascade constraints; +drop table if exists ACT_CMMN_RU_SENTRY_PART_INST cascade constraints; +drop table if exists ACT_CMMN_RU_PLAN_ITEM_INST cascade constraints; +drop table if exists ACT_CMMN_RU_CASE_INST cascade constraints; +drop table if exists ACT_CMMN_CASEDEF cascade constraints; +drop table if exists ACT_CMMN_DEPLOYMENT_RESOURCE cascade constraints; +drop table if exists ACT_CMMN_DEPLOYMENT cascade constraints; + +drop index if exists ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index if exists ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index if exists ACT_IDX_CASE_INST_REF_ID_; +drop index if exists ACT_IDX_CASE_DEF_UNIQ; +drop index if exists ACT_IDX_PLAN_ITEM_STAGE_INST; +drop index if exists ACT_IDX_MIL_CASE_INST; +drop index if exists ACT_IDX_MIL_CASE_DEF; +drop index if exists ACT_IDX_SENTRY_PLAN_ITEM; +drop index if exists ACT_IDX_SENTRY_CASE_INST; +drop index if exists ACT_IDX_SENTRY_CASE_DEF; +drop index if exists ACT_IDX_PLAN_ITEM_CASE_INST; +drop index if exists ACT_IDX_PLAN_ITEM_CASE_DEF; +drop index if exists ACT_IDX_CASE_INST_PARENT; +drop index if exists ACT_IDX_CASE_INST_CASE_DEF; +drop index if exists ACT_IDX_CASE_DEF_DPLY; +drop index if exists ACT_IDX_CMMN_RSRC_DPL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mssql.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mssql.drop.cmmn.sql new file mode 100644 index 00000000000..e19bb89763d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mssql.drop.cmmn.sql @@ -0,0 +1,38 @@ +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_HI_PLAN_ITEM_INST_CASE') drop index ACT_CMMN_HI_PLAN_ITEM_INST.ACT_IDX_HI_PLAN_ITEM_INST_CASE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_HI_PLAN_ITEM_INST_CASE') drop index ACT_CMMN_HI_PLAN_ITEM_INST.ACT_IDX_HI_PLAN_ITEM_INST_CASE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CASE_INST_REF_ID_') drop index ACT_CMMN_RU_CASE_INST.ACT_IDX_CASE_INST_REF_ID_; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CASE_DEF_UNIQ') drop index ACT_CMMN_CASEDEF.ACT_IDX_CASE_DEF_UNIQ; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_PLAN_ITEM_STAGE_INST') drop index ACT_CMMN_RU_PLAN_ITEM_INST.ACT_IDX_PLAN_ITEM_STAGE_INST; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_MIL_CASE_INST') drop index ACT_CMMN_RU_MIL_INST.ACT_IDX_MIL_CASE_INST; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_MIL_CASE_DEF') drop index ACT_CMMN_RU_MIL_INST.ACT_IDX_MIL_CASE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SENTRY_PLAN_ITEM') drop index ACT_CMMN_RU_SENTRY_PART_INST.ACT_IDX_SENTRY_PLAN_ITEM; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SENTRY_CASE_INST') drop index ACT_CMMN_RU_SENTRY_PART_INST.ACT_IDX_SENTRY_CASE_INST; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SENTRY_CASE_DEF') drop index ACT_CMMN_RU_SENTRY_PART_INST.ACT_IDX_SENTRY_CASE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_PLAN_ITEM_CASE_INST') drop index ACT_CMMN_RU_PLAN_ITEM_INST.ACT_IDX_PLAN_ITEM_CASE_INST; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_PLAN_ITEM_CASE_DEF') drop index ACT_CMMN_RU_PLAN_ITEM_INST.ACT_IDX_PLAN_ITEM_CASE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CASE_INST_PARENT') drop index ACT_CMMN_RU_CASE_INST.ACT_IDX_CASE_INST_PARENT; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CASE_INST_CASE_DEF') drop index ACT_CMMN_RU_CASE_INST.ACT_IDX_CASE_INST_CASE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CASE_DEF_DPLY') drop index ACT_CMMN_CASEDEF.ACT_IDX_CASE_DEF_DPLY; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CMMN_RSRC_DPL') drop index ACT_CMMN_DEPLOYMENT_RESOURCE.ACT_IDX_CMMN_RSRC_DPL; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_MIL_INST') alter table ACT_CMMN_RU_MIL_INST drop constraint ACT_FK_MIL_CASE_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_MIL_INST') alter table ACT_CMMN_RU_MIL_INST drop constraint ACT_FK_MIL_CASE_DEF; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_SENTRY_PART_INST') alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_PLAN_ITEM; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_SENTRY_PART_INST') alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_CASE_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_SENTRY_PART_INST') alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_CASE_DEF; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_PLAN_ITEM_INST') alter table ACT_CMMN_RU_PLAN_ITEM_INST drop constraint ACT_FK_PLAN_ITEM_CASE_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_PLAN_ITEM_INST') alter table ACT_CMMN_RU_PLAN_ITEM_INST drop constraint ACT_FK_PLAN_ITEM_CASE_DEF; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_CASE_INST') alter table ACT_CMMN_RU_CASE_INST drop constraint ACT_FK_CASE_INST_CASE_DEF; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_CASEDEF') alter table ACT_CMMN_CASEDEF drop constraint ACT_FK_CASE_DEF_DPLY; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_DEPLOYMENT_RESOURCE') alter table ACT_CMMN_DEPLOYMENT_RESOURCE drop constraint ACT_FK_CMMN_RSRC_DPL; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_HI_PLAN_ITEM_INST') drop table ACT_CMMN_HI_PLAN_ITEM_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_HI_MIL_INST') drop table ACT_CMMN_HI_MIL_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_HI_CASE_INST') drop table ACT_CMMN_HI_CASE_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_MIL_INST') drop table ACT_CMMN_RU_MIL_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_SENTRY_PART_INST') drop table ACT_CMMN_RU_SENTRY_PART_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_PLAN_ITEM_INST') drop table ACT_CMMN_RU_PLAN_ITEM_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_RU_CASE_INST') drop table ACT_CMMN_RU_CASE_INST; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_CASEDEF') drop table ACT_CMMN_CASEDEF; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_DEPLOYMENT_RESOURCE') drop table ACT_CMMN_DEPLOYMENT_RESOURCE; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_CMMN_DEPLOYMENT') drop table ACT_CMMN_DEPLOYMENT; \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mysql.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mysql.drop.cmmn.sql new file mode 100644 index 00000000000..166f46cc442 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.mysql.drop.cmmn.sql @@ -0,0 +1,38 @@ +alter table ACT_CMMN_RU_MIL_INST drop foreign key ACT_FK_MIL_CASE_INST; +alter table ACT_CMMN_RU_MIL_INST drop foreign key ACT_FK_MIL_CASE_DEF; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_PLAN_ITEM; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_CASE_INST; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop foreign key ACT_FK_SENTRY_CASE_DEF; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop foreign key ACT_FK_PLAN_ITEM_CASE_INST; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop foreign key ACT_FK_PLAN_ITEM_CASE_DEF; +alter table ACT_CMMN_RU_CASE_INST drop foreign key ACT_FK_CASE_INST_CASE_DEF; +alter table ACT_CMMN_CASEDEF drop foreign key ACT_FK_CASE_DEF_DPLY; +alter table ACT_CMMN_DEPLOYMENT_RESOURCE drop foreign key ACT_FK_CMMN_RSRC_DPL; + +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE on ACT_CMMN_HI_PLAN_ITEM_INST; +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE on ACT_CMMN_HI_PLAN_ITEM_INST; +drop index ACT_IDX_CASE_INST_REF_ID_ on ACT_CMMN_RU_CASE_INST; +drop index ACT_IDX_CASE_DEF_UNIQ on ACT_CMMN_CASEDEF; +drop index ACT_IDX_PLAN_ITEM_STAGE_INST on ACT_CMMN_RU_PLAN_ITEM_INST; +drop index ACT_IDX_MIL_CASE_INST on ACT_CMMN_RU_MIL_INST; +drop index ACT_IDX_MIL_CASE_DEF on ACT_CMMN_RU_MIL_INST; +drop index ACT_IDX_SENTRY_PLAN_ITEM on ACT_CMMN_RU_SENTRY_PART_INST; +drop index ACT_IDX_SENTRY_CASE_INST on ACT_CMMN_RU_SENTRY_PART_INST; +drop index ACT_IDX_SENTRY_CASE_DEF on ACT_CMMN_RU_SENTRY_PART_INST; +drop index ACT_IDX_PLAN_ITEM_CASE_INST on ACT_CMMN_RU_PLAN_ITEM_INST; +drop index ACT_IDX_PLAN_ITEM_CASE_DEF on ACT_CMMN_RU_PLAN_ITEM_INST; +drop index ACT_IDX_CASE_INST_PARENT on ACT_CMMN_RU_CASE_INST; +drop index ACT_IDX_CASE_INST_CASE_DEF on ACT_CMMN_RU_CASE_INST; +drop index ACT_IDX_CASE_DEF_DPLY on ACT_CMMN_CASEDEF; +drop index ACT_IDX_CMMN_RSRC_DPL on ACT_CMMN_DEPLOYMENT_RESOURCE; + +drop table if exists ACT_CMMN_HI_PLAN_ITEM_INST; +drop table if exists ACT_CMMN_HI_MIL_INST; +drop table if exists ACT_CMMN_HI_CASE_INST; +drop table if exists ACT_CMMN_RU_MIL_INST; +drop table if exists ACT_CMMN_RU_SENTRY_PART_INST; +drop table if exists ACT_CMMN_RU_PLAN_ITEM_INST; +drop table if exists ACT_CMMN_RU_CASE_INST; +drop table if exists ACT_CMMN_CASEDEF; +drop table if exists ACT_CMMN_DEPLOYMENT_RESOURCE; +drop table if exists ACT_CMMN_DEPLOYMENT; \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.oracle.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.oracle.drop.cmmn.sql new file mode 100644 index 00000000000..51fe702d6b4 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.oracle.drop.cmmn.sql @@ -0,0 +1,38 @@ +alter table ACT_CMMN_RU_MIL_INST drop constraint ACT_FK_MIL_CASE_INST; +alter table ACT_CMMN_RU_MIL_INST drop constraint ACT_FK_MIL_CASE_DEF; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_PLAN_ITEM; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_CASE_INST; +alter table ACT_CMMN_RU_SENTRY_PART_INST drop constraint ACT_FK_SENTRY_CASE_DEF; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop constraint ACT_FK_PLAN_ITEM_CASE_INST; +alter table ACT_CMMN_RU_PLAN_ITEM_INST drop constraint ACT_FK_PLAN_ITEM_CASE_DEF; +alter table ACT_CMMN_RU_CASE_INST drop constraint ACT_FK_CASE_INST_CASE_DEF; +alter table ACT_CMMN_CASEDEF drop constraint ACT_FK_CASE_DEF_DPLY; +alter table ACT_CMMN_DEPLOYMENT_RESOURCE drop constraint ACT_FK_CMMN_RSRC_DPL; + +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index ACT_IDX_HI_PLAN_ITEM_INST_CASE; +drop index ACT_IDX_CASE_INST_REF_ID_; +drop index ACT_IDX_CASE_DEF_UNIQ; +drop index ACT_IDX_PLAN_ITEM_STAGE_INST; +drop index ACT_IDX_MIL_CASE_INST; +drop index ACT_IDX_MIL_CASE_DEF; +drop index ACT_IDX_SENTRY_PLAN_ITEM; +drop index ACT_IDX_SENTRY_CASE_INST; +drop index ACT_IDX_SENTRY_CASE_DEF; +drop index ACT_IDX_PLAN_ITEM_CASE_INST; +drop index ACT_IDX_PLAN_ITEM_CASE_DEF; +drop index ACT_IDX_CASE_INST_PARENT; +drop index ACT_IDX_CASE_INST_CASE_DEF; +drop index ACT_IDX_CASE_DEF_DPLY; +drop index ACT_IDX_CMMN_RSRC_DPL; + +drop table ACT_CMMN_HI_PLAN_ITEM_INST; +drop table ACT_CMMN_HI_MIL_INST; +drop table ACT_CMMN_HI_CASE_INST; +drop table ACT_CMMN_RU_MIL_INST; +drop table ACT_CMMN_RU_SENTRY_PART_INST; +drop table ACT_CMMN_RU_PLAN_ITEM_INST; +drop table ACT_CMMN_RU_CASE_INST; +drop table ACT_CMMN_CASEDEF; +drop table ACT_CMMN_DEPLOYMENT_RESOURCE; +drop table ACT_CMMN_DEPLOYMENT; \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.postgres.drop.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.postgres.drop.cmmn.sql new file mode 100644 index 00000000000..4e88b07aa07 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/drop/flowable.postgres.drop.cmmn.sql @@ -0,0 +1,10 @@ +drop table ACT_CMMN_HI_PLAN_ITEM_INST cascade; +drop table ACT_CMMN_HI_MIL_INST cascade; +drop table ACT_CMMN_HI_CASE_INST cascade; +drop table ACT_CMMN_RU_MIL_INST cascade; +drop table ACT_CMMN_RU_SENTRY_PART_INST cascade; +drop table ACT_CMMN_RU_PLAN_ITEM_INST cascade; +drop table ACT_CMMN_RU_CASE_INST cascade; +drop table ACT_CMMN_CASEDEF cascade; +drop table ACT_CMMN_DEPLOYMENT_RESOURCE cascade; +drop table ACT_CMMN_DEPLOYMENT cascade; \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/db/CmmnEngineDropScriptsTest.java b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/db/CmmnEngineDropScriptsTest.java new file mode 100644 index 00000000000..1ac556a2a2c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/db/CmmnEngineDropScriptsTest.java @@ -0,0 +1,41 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.cmmn.test.db; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.flowable.cmmn.engine.test.FlowableCmmnTestCase; +import org.flowable.common.engine.impl.db.SchemaManager; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineBuild; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; +import org.junit.Test; + +/** + * @author Joram Barrez + */ +public class CmmnEngineDropScriptsTest extends FlowableCmmnTestCase { + + @Test + public void testDropSchema() { + + // Dropping and recreating the schema should not have an impact on other tests + SchemaManager schemaManager = cmmnEngineConfiguration.getSchemaManager(); + cmmnEngineConfiguration.getCommandExecutor().execute(new SchemaOperationsEngineDropDbCmd(cmmnEngineConfiguration.getEngineScopeType())); + assertThat(cmmnEngineConfiguration.getCmmnManagementService().getTableCounts(). + keySet().stream().filter(tableName -> tableName.toLowerCase().startsWith("act_cmmn"))).hasSize(0); + + cmmnEngineConfiguration.getCommandExecutor().execute(new SchemaOperationsEngineBuild(cmmnEngineConfiguration.getEngineScopeType())); + assertThat(cmmnEngineConfiguration.getCmmnManagementService().getTableCounts(). + keySet().stream().filter(tableName -> tableName.toLowerCase().startsWith("act_cmmn"))).hasSize(10); + } +} diff --git a/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.db2.drop.eventregistry.sql b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.db2.drop.eventregistry.sql new file mode 100644 index 00000000000..69da1f00a6d --- /dev/null +++ b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.db2.drop.eventregistry.sql @@ -0,0 +1,7 @@ +drop index ACT_IDX_CHANNEL_DEF_UNIQ; +drop index ACT_IDX_EVENT_DEF_UNIQ; + +drop table FLW_CHANNEL_DEFINITION; +drop table FLW_EVENT_DEFINITION; +drop table FLW_EVENT_RESOURCE; +drop table FLW_EVENT_DEPLOYMENT; diff --git a/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.mssql.drop.eventregistry.sql b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.mssql.drop.eventregistry.sql new file mode 100644 index 00000000000..25f6ff91d72 --- /dev/null +++ b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.mssql.drop.eventregistry.sql @@ -0,0 +1,7 @@ +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_CHANNEL_DEF_UNIQ') drop index FLW_CHANNEL_DEFINITION.ACT_IDX_CHANNEL_DEF_UNIQ; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EVENT_DEF_UNIQ') drop index FLW_EVENT_DEFINITION.ACT_IDX_EVENT_DEF_UNIQ; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_CHANNEL_DEFINITION') drop table FLW_CHANNEL_DEFINITION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_EVENT_DEFINITION') drop table FLW_EVENT_DEFINITION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_EVENT_RESOURCE') drop table FLW_EVENT_RESOURCE; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_EVENT_DEPLOYMENT') drop table FLW_EVENT_DEPLOYMENT; \ No newline at end of file diff --git a/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.oracle.drop.eventregistry.sql b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.oracle.drop.eventregistry.sql new file mode 100644 index 00000000000..69da1f00a6d --- /dev/null +++ b/modules/flowable-event-registry/src/main/resources/org/flowable/eventregistry/db/drop/flowable.oracle.drop.eventregistry.sql @@ -0,0 +1,7 @@ +drop index ACT_IDX_CHANNEL_DEF_UNIQ; +drop index ACT_IDX_EVENT_DEF_UNIQ; + +drop table FLW_CHANNEL_DEFINITION; +drop table FLW_EVENT_DEFINITION; +drop table FLW_EVENT_RESOURCE; +drop table FLW_EVENT_DEPLOYMENT;