项目开发使用 activiti 5.22.0,本地测试时产生了许多测试流程数据,部署时需要清掉这些垃圾数据,但又要保留流程定义及流程模型
根据官方文档,明确要清空的有 act_hi_ 和 act_ru_ 开头的表,但是这些表存在很多外键,于是就需要严格按照顺序来DELETE.
以下是清库脚本
DELETE FROM `act_hi_attachment`;
DELETE FROM `act_hi_comment`;
DELETE FROM `act_hi_detail`;
DELETE FROM `act_hi_actinst`;
DELETE FROM `act_hi_identitylink`;
DELETE FROM `act_hi_procinst`;
DELETE FROM `act_hi_taskinst`;
DELETE FROM `act_hi_varinst`;
DELETE FROM `act_ru_identitylink`;
DELETE FROM `act_ru_task`;
DELETE FROM `act_ru_variable`;
DELETE FROM `act_ru_execution` WHERE `PARENT_ID_` IS NOT NULL AND `IS_SCOPE_`=0;
DELETE FROM `act_ru_execution` WHERE `PARENT_ID_` IS NOT NULL AND `IS_SCOPE_`=1;
DELETE FROM `act_ru_execution`;