Activiti6数据库不删库的情况下删除表
由于activiti的表一般采用程序自动生成来创建,但这些表外键约束特别多,想要删除点数据或者在只能删表不能删除的情况进行delete table或者truncate table都会报外键约束,故整理了如下SQL脚本:
ALTER TABLE ACT_GE_BYTEARRAY DROP FOREIGN KEY `ACT_FK_BYTEARR_DEPL`; ALTER TABLE ACT_ID_MEMBERSHIP DROP FOREIGN KEY `ACT_FK_MEMB_GROUP`; ALTER TABLE ACT_ID_MEMBERSHIP DROP FOREIGN KEY `ACT_FK_MEMB_USER`; ALTER TABLE ACT_PROCDEF_INFO DROP FOREIGN KEY `ACT_FK_INFO_JSON_BA`; ALTER TABLE ACT_PROCDEF_INFO DROP FOREIGN KEY `ACT_FK_INFO_PROCDEF`; ALTER TABLE ACT_RE_MODEL DROP FOREIGN KEY `ACT_FK_MODEL_DEPLOYMENT`; ALTER TABLE ACT_RE_MODEL DROP FOREIGN KEY `ACT_FK_MODEL_SOURCE`; ALTER TABLE ACT_RE_MODEL DROP FOREIGN KEY `ACT_FK_MODEL_SOURCE_EXTRA`; ALTER TABLE ACT_RU_DEADLETTER_JOB DROP FOREIGN KEY `ACT_FK_DEADLETTER_JOB_EXCEPTION`; ALTER TABLE ACT_RU_DEADLETTER_JOB DROP FOREIGN KEY `ACT_FK_DEADLETTER_JOB_EXECUTION`; ALTER TABLE ACT_RU_DEADLETTER_JOB DROP FOREIGN KEY `ACT_FK_DEADLETTER_JOB_PROCESS_INSTANCE`; ALTER TABLE ACT_RU_DEADLETTER_JOB DROP FOREIGN KEY `ACT_FK_DEADLETTER_JOB_PROC_DEF`; ALTER TABLE ACT_RU_EVENT_SUBSCR DROP FOREIGN KEY `ACT_FK_EVENT_EXEC`; ALTER TABLE ACT_RU_EXECUTION DROP FOREIGN KEY `ACT_FK_EXE_PARENT`; ALTER TABLE ACT_RU_EXECUTION DROP FOREIGN KEY `ACT_FK_EXE_PROCDEF`; ALTER TABLE ACT_RU_EXECUTION DROP FOREIGN KEY `ACT_FK_EXE_PROCINST`; ALTER TABLE ACT_RU_EXECUTION DROP FOREIGN KEY `ACT_FK_EXE_SUPER`; ALTER TABLE ACT_RU_IDENTITYLINK DROP FOREIGN KEY `ACT_FK_ATHRZ_PROCEDEF`; ALTER TABLE ACT_RU_IDENTITYLINK DROP FOREIGN KEY `ACT_FK_IDL_PROCINST`; ALTER TABLE ACT_RU_IDENTITYLINK DROP FOREIGN KEY `ACT_FK_TSKASS_TASK`; ALTER TABLE ACT_RU_JOB DROP FOREIGN KEY `ACT_FK_JOB_EXCEPTION`; ALTER TABLE ACT_RU_JOB DROP FOREIGN KEY `ACT_FK_JOB_EXECUTION`; ALTER TABLE ACT_RU_JOB DROP FOREIGN KEY `ACT_FK_JOB_PROCESS_INSTANCE`; ALTER TABLE ACT_RU_JOB DROP FOREIGN KEY `ACT_FK_JOB_PROC_DEF`; ALTER TABLE ACT_RU_SUSPENDED_JOB DROP FOREIGN KEY `ACT_FK_SUSPENDED_JOB_EXCEPTION`; ALTER TABLE ACT_RU_SUSPENDED_JOB DROP FOREIGN KEY `ACT_FK_SUSPENDED_JOB_EXECUTION`; ALTER TABLE ACT_RU_SUSPENDED_JOB DROP FOREIGN KEY `ACT_FK_SUSPENDED_JOB_PROCESS_INSTANCE`; ALTER TABLE ACT_RU_SUSPENDED_JOB DROP FOREIGN KEY `ACT_FK_SUSPENDED_JOB_PROC_DEF`; ALTER TABLE ACT_RU_TASK DROP FOREIGN KEY `ACT_FK_TASK_EXE`; ALTER TABLE ACT_RU_TASK DROP FOREIGN KEY `ACT_FK_TASK_PROCDEF`; ALTER TABLE ACT_RU_TASK DROP FOREIGN KEY `ACT_FK_TASK_PROCINST`; ALTER TABLE ACT_RU_TIMER_JOB DROP FOREIGN KEY `ACT_FK_TIMER_JOB_EXCEPTION`; ALTER TABLE ACT_RU_TIMER_JOB DROP FOREIGN KEY `ACT_FK_TIMER_JOB_EXECUTION`; ALTER TABLE ACT_RU_TIMER_JOB DROP FOREIGN KEY `ACT_FK_TIMER_JOB_PROCESS_INSTANCE`; ALTER TABLE ACT_RU_TIMER_JOB DROP FOREIGN KEY `ACT_FK_TIMER_JOB_PROC_DEF`; ALTER TABLE ACT_RU_VARIABLE DROP FOREIGN KEY `ACT_FK_VAR_BYTEARRAY`; ALTER TABLE ACT_RU_VARIABLE DROP FOREIGN KEY `ACT_FK_VAR_EXE`;
ALTER TABLE ACT_RU_VARIABLE DROP FOREIGN KEY `ACT_FK_VAR_PROCINST`; DROP TABLE ACT_EVT_LOG; DROP TABLE ACT_GE_BYTEARRAY; DROP TABLE ACT_GE_PROPERTY; DROP TABLE ACT_HI_ACTINST; DROP TABLE ACT_HI_ATTACHMENT; DROP TABLE ACT_HI_COMMENT; DROP TABLE ACT_HI_DETAIL; DROP TABLE ACT_HI_IDENTITYLINK; DROP TABLE ACT_HI_PROCINST; DROP TABLE ACT_HI_TASKINST; DROP TABLE ACT_HI_VARINST; DROP TABLE ACT_ID_GROUP; DROP TABLE ACT_ID_INFO; DROP TABLE ACT_ID_MEMBERSHIP; DROP TABLE ACT_ID_USER; DROP TABLE ACT_PROCDEF_INFO; DROP TABLE ACT_RE_DEPLOYMENT; DROP TABLE ACT_RE_MODEL; DROP TABLE ACT_RE_PROCDEF; DROP TABLE ACT_RU_DEADLETTER_JOB; DROP TABLE ACT_RU_EVENT_SUBSCR; DROP TABLE ACT_RU_EXECUTION; DROP TABLE ACT_RU_IDENTITYLINK; DROP TABLE ACT_RU_JOB; DROP TABLE ACT_RU_SUSPENDED_JOB; DROP TABLE ACT_RU_TASK; DROP TABLE ACT_RU_TIMER_JOB; DROP TABLE ACT_RU_VARIABLE;