--
-- Clean the data only by removing the constraint and re-enabling them.
--

-- Disable constraint (no order)
ALTER TABLE JBPM_ACTION disable  CONSTRAINT FKD5A74807E4E3BFE;
ALTER TABLE JBPM_DEFINITION disable  CONSTRAINT FK2F4CEE9D66309C76;
ALTER TABLE JBPM_DEFINITION disable  CONSTRAINT FK2F4CEE9DA1927D4F;
ALTER TABLE JBPM_DEFINITION disable  CONSTRAINT FK2F4CEE9DC3893553;
ALTER TABLE JBPM_DELEGATION disable  CONSTRAINT FKBE986672C3893553;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3C13ED2894;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3C68AC491;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3C696B9F9;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3CAA98F31;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3CB413BAF7;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3CB58AFBE4;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3CB58AFBE5;
ALTER TABLE JBPM_EXELOG disable  CONSTRAINT FKB54EFE3CBAC048E9;
ALTER TABLE JBPM_INVOKELOG disable  CONSTRAINT FKDDF9DD22696B9F9;
ALTER TABLE JBPM_JOB disable  CONSTRAINT FK375F5193696B9F9;
ALTER TABLE JBPM_JOB disable  CONSTRAINT FK375F51937E4E3BFE;
ALTER TABLE JBPM_JOB disable  CONSTRAINT FK375F5193842C3824;
ALTER TABLE JBPM_NODE disable  CONSTRAINT FKB48CB2CC52D4AD28;
ALTER TABLE JBPM_NODE disable  CONSTRAINT FKB48CB2CCC3893553;
ALTER TABLE JBPM_NODE disable  CONSTRAINT FKB48CB2CCF41BD495;
ALTER TABLE JBPM_NODE disable  CONSTRAINT FKB48CB2CCF41DA4FD;
ALTER TABLE JBPM_NODE disable  CONSTRAINT FKB48CB2CCFA8C2074;
ALTER TABLE JBPM_PROCESSINSTANCE disable  CONSTRAINT FK236E60DA3580E2;
ALTER TABLE JBPM_PROCESSINSTANCE disable  CONSTRAINT FK236E60DA76CFBBE5;
ALTER TABLE JBPM_PROCESSINSTANCE disable  CONSTRAINT FK236E60DAC3893553;
ALTER TABLE JBPM_SWIMLANE disable  CONSTRAINT FK1DD2A83E52D4AD28;
ALTER TABLE JBPM_SWIMLANE disable  CONSTRAINT FK1DD2A83EC3893553;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4F68AC491;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4F842C3824;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4F96611053;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4FC4AB08AA;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4FCDC0E9C4;
ALTER TABLE JBPM_TOKEN disable  CONSTRAINT FKDD5E4E4FE805D1A9;
ALTER TABLE JBPM_TRANSITION disable  CONSTRAINT FK4FF269F1C144;
ALTER TABLE JBPM_TRANSITION disable  CONSTRAINT FK4FF269F5D2DDF5;
ALTER TABLE JBPM_TRANSITION disable  CONSTRAINT FK4FF269FC3893553;
ALTER TABLE JBPM_TYPE disable  CONSTRAINT FKB48F940452D4AD28;
ALTER TABLE JBPM_TYPE disable  CONSTRAINT FKB48F9404C3893553;
ALTER TABLE JBPM_VARIABLE disable  CONSTRAINT FKD8CB5A4669B5865;
ALTER TABLE JBPM_VARIABLE disable  CONSTRAINT FKD8CB5A46C3893553;
ALTER TABLE JBPM_VARIABLEINSTANCE disable  CONSTRAINT FKC74438DB696B9F9;
ALTER TABLE JBPM_VARIABLEINSTANCE disable  CONSTRAINT FKC74438DB69B5865;

-- Truncate data
TRUNCATE TABLE JBPM_ACTION;
TRUNCATE TABLE JBPM_EXELOG;
TRUNCATE TABLE JBPM_DEFINITION;
TRUNCATE TABLE JBPM_DELEGATION;
TRUNCATE TABLE JBPM_FILE;
TRUNCATE TABLE JBPM_INVOKELOG;
TRUNCATE TABLE JBPM_JOB;
TRUNCATE TABLE JBPM_NODE;
TRUNCATE TABLE JBPM_PROCESSINSTANCE;
TRUNCATE TABLE JBPM_SEQUENCEBLOCK;
TRUNCATE TABLE JBPM_SWIMLANE;
TRUNCATE TABLE JBPM_TOKEN;
TRUNCATE TABLE JBPM_TYPE;
TRUNCATE TABLE JBPM_TRANSITION;
TRUNCATE TABLE JBPM_VARIABLE;
TRUNCATE TABLE JBPM_VARIABLEINSTANCE;

-- Enable the constraints
ALTER TABLE JBPM_ACTION enable  CONSTRAINT FKD5A74807E4E3BFE;
ALTER TABLE JBPM_DEFINITION enable  CONSTRAINT FK2F4CEE9D66309C76;
ALTER TABLE JBPM_DEFINITION enable  CONSTRAINT FK2F4CEE9DA1927D4F;
ALTER TABLE JBPM_DEFINITION enable  CONSTRAINT FK2F4CEE9DC3893553;
ALTER TABLE JBPM_DELEGATION enable  CONSTRAINT FKBE986672C3893553;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3C13ED2894;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3C68AC491;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3C696B9F9;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3CAA98F31;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3CB413BAF7;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3CB58AFBE4;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3CB58AFBE5;
ALTER TABLE JBPM_EXELOG enable  CONSTRAINT FKB54EFE3CBAC048E9;
ALTER TABLE JBPM_INVOKELOG enable  CONSTRAINT FKDDF9DD22696B9F9;
ALTER TABLE JBPM_JOB enable  CONSTRAINT FK375F5193696B9F9;
ALTER TABLE JBPM_JOB enable  CONSTRAINT FK375F51937E4E3BFE;
ALTER TABLE JBPM_JOB enable  CONSTRAINT FK375F5193842C3824;
ALTER TABLE JBPM_NODE enable  CONSTRAINT FKB48CB2CC52D4AD28;
ALTER TABLE JBPM_NODE enable  CONSTRAINT FKB48CB2CCC3893553;
ALTER TABLE JBPM_NODE enable  CONSTRAINT FKB48CB2CCF41BD495;
ALTER TABLE JBPM_NODE enable  CONSTRAINT FKB48CB2CCF41DA4FD;
ALTER TABLE JBPM_NODE enable  CONSTRAINT FKB48CB2CCFA8C2074;
ALTER TABLE JBPM_PROCESSINSTANCE enable  CONSTRAINT FK236E60DA3580E2;
ALTER TABLE JBPM_PROCESSINSTANCE enable  CONSTRAINT FK236E60DA76CFBBE5;
ALTER TABLE JBPM_PROCESSINSTANCE enable  CONSTRAINT FK236E60DAC3893553;
ALTER TABLE JBPM_SWIMLANE enable  CONSTRAINT FK1DD2A83E52D4AD28;
ALTER TABLE JBPM_SWIMLANE enable  CONSTRAINT FK1DD2A83EC3893553;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4F68AC491;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4F842C3824;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4F96611053;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4FC4AB08AA;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4FCDC0E9C4;
ALTER TABLE JBPM_TOKEN enable  CONSTRAINT FKDD5E4E4FE805D1A9;
ALTER TABLE JBPM_TRANSITION enable  CONSTRAINT FK4FF269F1C144;
ALTER TABLE JBPM_TRANSITION enable  CONSTRAINT FK4FF269F5D2DDF5;
ALTER TABLE JBPM_TRANSITION enable  CONSTRAINT FK4FF269FC3893553;
ALTER TABLE JBPM_TYPE enable  CONSTRAINT FKB48F940452D4AD28;
ALTER TABLE JBPM_TYPE enable  CONSTRAINT FKB48F9404C3893553;
ALTER TABLE JBPM_VARIABLE enable  CONSTRAINT FKD8CB5A4669B5865;
ALTER TABLE JBPM_VARIABLE enable  CONSTRAINT FKD8CB5A46C3893553;
ALTER TABLE JBPM_VARIABLEINSTANCE enable  CONSTRAINT FKC74438DB696B9F9;
ALTER TABLE JBPM_VARIABLEINSTANCE enable  CONSTRAINT FKC74438DB69B5865;
