DROP TABLE JBPM_ACTION cascade constraints;
DROP TABLE JBPM_BYTEARRAY cascade constraints;
DROP TABLE JBPM_BYTEBLOCK cascade constraints;
DROP TABLE JBPM_COMMENT cascade constraints;
DROP TABLE JBPM_DECISIONCONDITIONS cascade constraints;
DROP TABLE JBPM_DELEGATION cascade constraints;
DROP TABLE JBPM_EVENT cascade constraints;
DROP TABLE JBPM_EXCEPTIONHANDLER cascade constraints;
DROP TABLE JBPM_JOB cascade constraints;
DROP TABLE JBPM_LOG cascade constraints;
DROP TABLE JBPM_MODULEDEFINITION cascade constraints;
DROP TABLE JBPM_MODULEINSTANCE cascade constraints;
DROP TABLE JBPM_NODE cascade constraints;
DROP TABLE JBPM_POOLEDACTOR cascade constraints;
DROP TABLE JBPM_PROCESSDEFINITION cascade constraints;
DROP TABLE JBPM_PROCESSINSTANCE cascade constraints;
DROP TABLE JBPM_RUNTIMEACTION cascade constraints;
DROP TABLE JBPM_SWIMLANE cascade constraints;
DROP TABLE JBPM_SWIMLANEINSTANCE cascade constraints;
DROP TABLE JBPM_TASK cascade constraints;
DROP TABLE JBPM_TASKACTORPOOL cascade constraints;
DROP TABLE JBPM_TASKCONTROLLER cascade constraints;
DROP TABLE JBPM_TASKINSTANCE cascade constraints;
DROP TABLE JBPM_TOKEN cascade constraints;
DROP TABLE JBPM_TOKENVARIABLEMAP cascade constraints;
DROP TABLE JBPM_TRANSITION cascade constraints;
DROP TABLE JBPM_VARIABLEACCESS cascade constraints;
DROP TABLE JBPM_VARIABLEINSTANCE cascade constraints;
DROP TABLE OKM_ACTIVITY cascade constraints;
DROP TABLE OKM_BOOKMARK cascade constraints;
DROP TABLE OKM_CRON_TAB cascade constraints;
DROP TABLE OKM_DASHBOARD cascade constraints;
DROP TABLE OKM_EXTENSION cascade constraints;
DROP TABLE OKM_FILTER_RULE cascade constraints;
DROP TABLE OKM_LOCK_TOKEN cascade constraints;
DROP TABLE OKM_MAIL_ACCOUNT cascade constraints;
DROP TABLE OKM_MAIL_FILTER cascade constraints;
DROP TABLE OKM_MIME_TYPE cascade constraints;
DROP TABLE OKM_MIME_TYPE_EXTENSION cascade constraints;
DROP TABLE OKM_PROFILE cascade constraints;
DROP TABLE OKM_QUERY_PARAMS cascade constraints;
DROP TABLE OKM_QUERY_PARAMS_CATEGORY cascade constraints;
DROP TABLE OKM_QUERY_PARAMS_KEYWORD cascade constraints;
DROP TABLE OKM_QUERY_PARAMS_PROPERTY cascade constraints;
DROP TABLE OKM_REPORT cascade constraints;
DROP TABLE OKM_ROLE cascade constraints;
DROP TABLE OKM_STAPLE cascade constraints;
DROP TABLE OKM_STAPLE_GROUP cascade constraints;
DROP TABLE OKM_TWITTER_ACCOUNT cascade constraints;
DROP TABLE OKM_USER cascade constraints;
DROP TABLE OKM_USER_CONFIG cascade constraints;
DROP TABLE OKM_USER_DOCUMENT cascade constraints;
DROP TABLE OKM_USER_DOCUMENT_KEYWORD cascade constraints;
DROP TABLE OKM_USER_ITEMS cascade constraints;
DROP TABLE OKM_USER_ROLE cascade constraints;
DROP sequence hibernate_sequence;
CREATE TABLE JBPM_ACTION (ID_ number(19,0) NOT NULL, class char(1) NOT NULL, NAME_ varchar2(255), ISPROPAGATIONALLOWED_ number(1,0), ACTIONEXPRESSION_ varchar2(255), ISASYNC_ number(1,0), REFERENCEDACTION_ number(19,0), ACTIONDELEGATION_ number(19,0), EVENT_ number(19,0), PROCESSDEFINITION_ number(19,0), EXPRESSION_ varchar2(4000), TIMERNAME_ varchar2(255), DUEDATE_ varchar2(255), REPEAT_ varchar2(255), TRANSITIONNAME_ varchar2(255), TIMERACTION_ number(19,0), EVENTINDEX_ number(10,0), EXCEPTIONHANDLER_ number(19,0), EXCEPTIONHANDLERINDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_BYTEARRAY (ID_ number(19,0) NOT NULL, NAME_ varchar2(255), FILEDEFINITION_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_BYTEBLOCK (PROCESSFILE_ number(19,0) NOT NULL, BYTES_ raw(1024), INDEX_ number(10,0) NOT NULL, PRIMARY KEY (PROCESSFILE_, INDEX_));
CREATE TABLE JBPM_COMMENT (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, ACTORID_ varchar2(255), TIME_ date, MESSAGE_ varchar2(4000), TOKEN_ number(19,0), TASKINSTANCE_ number(19,0), TOKENINDEX_ number(10,0), TASKINSTANCEINDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_DECISIONCONDITIONS (DECISION_ number(19,0) NOT NULL, TRANSITIONNAME_ varchar2(255), EXPRESSION_ varchar2(255), INDEX_ number(10,0) NOT NULL, PRIMARY KEY (DECISION_, INDEX_));
CREATE TABLE JBPM_DELEGATION (ID_ number(19,0) NOT NULL, CLASSNAME_ varchar2(4000), CONFIGURATION_ varchar2(4000), CONFIGTYPE_ varchar2(255), PROCESSDEFINITION_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_EVENT (ID_ number(19,0) NOT NULL, EVENTTYPE_ varchar2(255), TYPE_ char(1), GRAPHELEMENT_ number(19,0), PROCESSDEFINITION_ number(19,0), NODE_ number(19,0), TRANSITION_ number(19,0), TASK_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_EXCEPTIONHANDLER (ID_ number(19,0) NOT NULL, EXCEPTIONCLASSNAME_ varchar2(4000), TYPE_ char(1), GRAPHELEMENT_ number(19,0), PROCESSDEFINITION_ number(19,0), GRAPHELEMENTINDEX_ number(10,0), NODE_ number(19,0), TRANSITION_ number(19,0), TASK_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_JOB (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, VERSION_ number(10,0) NOT NULL, DUEDATE_ date, PROCESSINSTANCE_ number(19,0), TOKEN_ number(19,0), TASKINSTANCE_ number(19,0), ISSUSPENDED_ number(1,0), ISEXCLUSIVE_ number(1,0), LOCKOWNER_ varchar2(255), LOCKTIME_ date, EXCEPTION_ varchar2(4000), RETRIES_ number(10,0), NAME_ varchar2(255), REPEAT_ varchar2(255), TRANSITIONNAME_ varchar2(255), ACTION_ number(19,0), GRAPHELEMENTTYPE_ varchar2(255), GRAPHELEMENT_ number(19,0), NODE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_LOG (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, INDEX_ number(10,0), DATE_ date, TOKEN_ number(19,0), PARENT_ number(19,0), MESSAGE_ varchar2(4000), EXCEPTION_ varchar2(4000), ACTION_ number(19,0), NODE_ number(19,0), ENTER_ date, LEAVE_ date, DURATION_ number(19,0), NEWLONGVALUE_ number(19,0), TRANSITION_ number(19,0), CHILD_ number(19,0), SOURCENODE_ number(19,0), DESTINATIONNODE_ number(19,0), VARIABLEINSTANCE_ number(19,0), OLDBYTEARRAY_ number(19,0), NEWBYTEARRAY_ number(19,0), OLDDATEVALUE_ date, NEWDATEVALUE_ date, OLDDOUBLEVALUE_ double precision, NEWDOUBLEVALUE_ double precision, OLDLONGIDCLASS_ varchar2(255), OLDLONGIDVALUE_ number(19,0), NEWLONGIDCLASS_ varchar2(255), NEWLONGIDVALUE_ number(19,0), OLDSTRINGIDCLASS_ varchar2(255), OLDSTRINGIDVALUE_ varchar2(255), NEWSTRINGIDCLASS_ varchar2(255), NEWSTRINGIDVALUE_ varchar2(255), OLDLONGVALUE_ number(19,0), OLDSTRINGVALUE_ varchar2(4000), NEWSTRINGVALUE_ varchar2(4000), TASKINSTANCE_ number(19,0), TASKACTORID_ varchar2(255), TASKOLDACTORID_ varchar2(255), SWIMLANEINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_MODULEDEFINITION (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, NAME_ varchar2(4000), PROCESSDEFINITION_ number(19,0), STARTTASK_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_MODULEINSTANCE (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, VERSION_ number(10,0) NOT NULL, PROCESSINSTANCE_ number(19,0), TASKMGMTDEFINITION_ number(19,0), NAME_ varchar2(255), PRIMARY KEY (ID_));
CREATE TABLE JBPM_NODE (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, NAME_ varchar2(255), DESCRIPTION_ varchar2(4000), PROCESSDEFINITION_ number(19,0), ISASYNC_ number(1,0), ISASYNCEXCL_ number(1,0), ACTION_ number(19,0), SUPERSTATE_ number(19,0), SUBPROCNAME_ varchar2(255), SUBPROCESSDEFINITION_ number(19,0), DECISIONEXPRESSION_ varchar2(255), DECISIONDELEGATION number(19,0), SCRIPT_ number(19,0), SIGNAL_ number(10,0), CREATETASKS_ number(1,0), ENDTASKS_ number(1,0), NODECOLLECTIONINDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_POOLEDACTOR (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, ACTORID_ varchar2(255), SWIMLANEINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_PROCESSDEFINITION (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, NAME_ varchar2(255), DESCRIPTION_ varchar2(4000), VERSION_ number(10,0), ISTERMINATIONIMPLICIT_ number(1,0), STARTSTATE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_PROCESSINSTANCE (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, KEY_ varchar2(255), START_ date, END_ date, ISSUSPENDED_ number(1,0), PROCESSDEFINITION_ number(19,0), ROOTTOKEN_ number(19,0), SUPERPROCESSTOKEN_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_RUNTIMEACTION (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, EVENTTYPE_ varchar2(255), TYPE_ char(1), GRAPHELEMENT_ number(19,0), PROCESSINSTANCE_ number(19,0), ACTION_ number(19,0), PROCESSINSTANCEINDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_SWIMLANE (ID_ number(19,0) NOT NULL, NAME_ varchar2(255), ACTORIDEXPRESSION_ varchar2(255), POOLEDACTORSEXPRESSION_ varchar2(255), ASSIGNMENTDELEGATION_ number(19,0), TASKMGMTDEFINITION_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_SWIMLANEINSTANCE (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, NAME_ varchar2(255), ACTORID_ varchar2(255), SWIMLANE_ number(19,0), TASKMGMTINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TASK (ID_ number(19,0) NOT NULL, NAME_ varchar2(255), DESCRIPTION_ varchar2(4000), PROCESSDEFINITION_ number(19,0), ISBLOCKING_ number(1,0), ISSIGNALLING_ number(1,0), CONDITION_ varchar2(255), DUEDATE_ varchar2(255), PRIORITY_ number(10,0), ACTORIDEXPRESSION_ varchar2(255), POOLEDACTORSEXPRESSION_ varchar2(255), TASKMGMTDEFINITION_ number(19,0), TASKNODE_ number(19,0), STARTSTATE_ number(19,0), ASSIGNMENTDELEGATION_ number(19,0), SWIMLANE_ number(19,0), TASKCONTROLLER_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TASKACTORPOOL (TASKINSTANCE_ number(19,0) NOT NULL, POOLEDACTOR_ number(19,0) NOT NULL, PRIMARY KEY (TASKINSTANCE_, POOLEDACTOR_));
CREATE TABLE JBPM_TASKCONTROLLER (ID_ number(19,0) NOT NULL, TASKCONTROLLERDELEGATION_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TASKINSTANCE (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, VERSION_ number(10,0) NOT NULL, NAME_ varchar2(255), DESCRIPTION_ varchar2(4000), ACTORID_ varchar2(255), CREATE_ date, START_ date, END_ date, DUEDATE_ date, PRIORITY_ number(10,0), ISCANCELLED_ number(1,0), ISSUSPENDED_ number(1,0), ISOPEN_ number(1,0), ISSIGNALLING_ number(1,0), ISBLOCKING_ number(1,0), TASK_ number(19,0), TOKEN_ number(19,0), PROCINST_ number(19,0), SWIMLANINSTANCE_ number(19,0), TASKMGMTINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TOKEN (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, NAME_ varchar2(255), START_ date, END_ date, NODEENTER_ date, NEXTLOGINDEX_ number(10,0), ISABLETOREACTIVATEPARENT_ number(1,0), ISTERMINATIONIMPLICIT_ number(1,0), ISSUSPENDED_ number(1,0), LOCK_ varchar2(255), NODE_ number(19,0), PROCESSINSTANCE_ number(19,0), PARENT_ number(19,0), SUBPROCESSINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TOKENVARIABLEMAP (ID_ number(19,0) NOT NULL, VERSION_ number(10,0) NOT NULL, TOKEN_ number(19,0), CONTEXTINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_TRANSITION (ID_ number(19,0) NOT NULL, NAME_ varchar2(255), DESCRIPTION_ varchar2(4000), PROCESSDEFINITION_ number(19,0), FROM_ number(19,0), TO_ number(19,0), CONDITION_ varchar2(255), FROMINDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_VARIABLEACCESS (ID_ number(19,0) NOT NULL, VARIABLENAME_ varchar2(255), ACCESS_ varchar2(255), MAPPEDNAME_ varchar2(255), SCRIPT_ number(19,0), PROCESSSTATE_ number(19,0), TASKCONTROLLER_ number(19,0), INDEX_ number(10,0), PRIMARY KEY (ID_));
CREATE TABLE JBPM_VARIABLEINSTANCE (ID_ number(19,0) NOT NULL, CLASS_ char(1) NOT NULL, VERSION_ number(10,0) NOT NULL, NAME_ varchar2(255), CONVERTER_ char(1), TOKEN_ number(19,0), TOKENVARIABLEMAP_ number(19,0), PROCESSINSTANCE_ number(19,0), BYTEARRAYVALUE_ number(19,0), DATEVALUE_ date, DOUBLEVALUE_ double precision, LONGIDCLASS_ varchar2(255), LONGVALUE_ number(19,0), STRINGIDCLASS_ varchar2(255), STRINGVALUE_ varchar2(4000), TASKINSTANCE_ number(19,0), PRIMARY KEY (ID_));
CREATE TABLE OKM_ACTIVITY (ACT_ID number(10,0) NOT NULL, ACT_DATE date NOT NULL, ACT_USER varchar2(127) NOT NULL, ACT_ACTION varchar2(255) NOT NULL, ACT_ITEM varchar2(4000), ACT_PARAMS clob, PRIMARY KEY (ACT_ID));
CREATE TABLE OKM_BOOKMARK (BM_ID number(10,0) NOT NULL, BM_USER varchar2(127) NOT NULL, BM_NAME varchar2(255) NOT NULL, BM_PATH varchar2(255) NOT NULL, BM_UUID varchar2(255) NOT NULL, BM_TYPE varchar2(255) NOT NULL, PRIMARY KEY (BM_ID));
CREATE TABLE OKM_CRON_TAB (CT_ID number(10,0) NOT NULL, CT_NAME varchar2(255) NOT NULL, CT_EXPRESSION varchar2(255) NOT NULL, CT_TYPE varchar2(255) NOT NULL, CT_FILE_CONTENT clob NOT NULL, CT_FILE_NAME varchar2(255) NOT NULL, CT_MAIL varchar2(255) NOT NULL, CT_ACTIVE number(1,0) NOT NULL, CT_LAST_BEGIN date, CT_LAST_END date, PRIMARY KEY (CT_ID));
CREATE TABLE OKM_DASHBOARD (DB_ID number(10,0) NOT NULL, DB_USER varchar2(127) NOT NULL, DB_SOURCE varchar2(255) NOT NULL, DB_NODE varchar2(255) NOT NULL, DB_DATE date NOT NULL, PRIMARY KEY (DB_ID));
CREATE TABLE OKM_EXTENSION (EX_UUID varchar2(127) NOT NULL, EX_DESCRIPTION varchar2(512) NOT NULL, PRIMARY KEY (EX_UUID));
CREATE TABLE OKM_FILTER_RULE (FR_ID number(10,0) NOT NULL, FR_FIELD varchar2(255) NOT NULL, FR_OPERATION varchar2(255) NOT NULL, FR_VALUE varchar2(255) NOT NULL, FR_ACTIVE number(1,0) NOT NULL, FR_MAIL_FILTER number(10,0) NOT NULL, PRIMARY KEY (FR_ID));
CREATE TABLE OKM_LOCK_TOKEN (LT_ID number(10,0) NOT NULL, LT_USER varchar2(127) NOT NULL, LT_TOKEN varchar2(255) NOT NULL UNIQUE, PRIMARY KEY (LT_ID));
CREATE TABLE OKM_MAIL_ACCOUNT (MA_ID number(10,0) NOT NULL, MA_USER varchar2(127) NOT NULL, MA_MPROTOCOL varchar2(255) NOT NULL, MA_MHOST varchar2(255) NOT NULL, MA_MFOLDER varchar2(255) NOT NULL, MA_MUSER varchar2(255) NOT NULL, MA_MPASSWORD varchar2(255) NOT NULL, MA_MMARK_SEEN number(1,0) NOT NULL, MA_MMARK_DELETED number(1,0) NOT NULL, MA_ACTIVE number(1,0) NOT NULL, PRIMARY KEY (MA_ID));
CREATE TABLE OKM_MAIL_FILTER (MF_ID number(10,0) NOT NULL, MF_PATH varchar2(255) NOT NULL, MF_UUID varchar2(255) NOT NULL, MF_GROUPING number(1,0) NOT NULL, MF_ACTIVE number(1,0) NOT NULL, MF_MAIL_ACCOUNT number(10,0) NOT NULL, PRIMARY KEY (MF_ID));
CREATE TABLE OKM_MIME_TYPE (MT_ID number(10,0) NOT NULL, MT_NAME varchar2(255) NOT NULL UNIQUE, MT_IMAGE_CONTENT clob NOT NULL, MT_IMAGE_MIME varchar2(255) NOT NULL, PRIMARY KEY (MT_ID));
CREATE TABLE OKM_MIME_TYPE_EXTENSION (MTE_ID number(10,0) NOT NULL, MTE_NAME varchar2(255));
CREATE TABLE OKM_PROFILE (PRF_ID number(10,0) NOT NULL, PRF_NAME varchar2(255) NOT NULL, PRF_ACTIVE number(1,0) NOT NULL, PRF_MSC_ADVANCED_FILTERS number(1,0) DEFAULT 0, PRF_MSC_USER_QUOTA number(19,0) DEFAULT 0, PRF_MSC_WEB_SKIN varchar2(255) DEFAULT 'default', PRF_CHT_CHAT_EN number(1,0) DEFAULT 0, PRF_CHT_AUTO_LOGIN_EN number(1,0) DEFAULT 0, PRF_WZRD_PROPERTY_GROUPS varchar2(255) DEFAULT '', PRF_WZRD_WORKFLOWS varchar2(255) DEFAULT '', PRF_WZRD_KEYWORDS_EN number(1,0) DEFAULT 0, PRF_WZRD_CATEGORIES_EN number(1,0) DEFAULT 0, PRF_STCK_TAXONOMY_VIS number(1,0) DEFAULT 1, PRF_STCK_CATEGORIES_VIS number(1,0) DEFAULT 1, PRF_STCK_THESAURUS_VIS number(1,0) DEFAULT 1, PRF_STCK_TEMPLATES_VIS number(1,0) DEFAULT 1, PRF_STCK_PERSONAL_VIS number(1,0) DEFAULT 1, PRF_STCK_MAIL_VIS number(1,0) DEFAULT 1, PRF_STCK_TRASH_VIS number(1,0) DEFAULT 1, PRF_TB_DESKTOP_VIS number(1,0) DEFAULT 1, PRF_TB_SEARCH_VIS number(1,0) DEFAULT 1, PRF_TB_DASHBOARD_VIS number(1,0) DEFAULT 1, PRF_TB_ADMIN_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_PROPS_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_SECURITY_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_NOTES_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_VERSIONS_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_PREVIEW_VIS number(1,0) DEFAULT 1, PRF_TB_DOC_PROP_GRPS_VIS number(1,0) DEFAULT 1, PRF_TB_FLD_PROPS_VIS number(1,0) DEFAULT 1, PRF_TB_FLD_SECURITY_VIS number(1,0) DEFAULT 1, PRF_TB_ML_PROPS_VIS number(1,0) DEFAULT 1, PRF_TB_ML_SECURITY_VIS number(1,0) DEFAULT 1, PRF_DB_USER_VIS number(1,0) DEFAULT 1, PRF_DB_MAIL_VIS number(1,0) DEFAULT 1, PRF_DB_NEWS_VIS number(1,0) DEFAULT 1, PRF_DB_GENERAL_VIS number(1,0) DEFAULT 1, PRF_DB_WORKFLOW_VIS number(1,0) DEFAULT 1, PRF_DB_KEYWORDS_VIS number(1,0) DEFAULT 1, PRF_MN_FILE_VIS number(1,0) DEFAULT 1, PRF_MN_EDIT_VIS number(1,0) DEFAULT 1, PRF_MN_TOOLS_VIS number(1,0) DEFAULT 1, PRF_MN_BOOKMARKS_VIS number(1,0) DEFAULT 1, PRF_MN_HELP_VIS number(1,0) DEFAULT 1, PRF_MN_FI_CREATE_FLD_VIS number(1,0) DEFAULT 1, PRF_MN_FI_FIND_FLD_VIS number(1,0) DEFAULT 1, PRF_MN_FI_GO_FLD_VIS number(1,0) DEFAULT 1, PRF_MN_FI_DOWNLOAD_VIS number(1,0) DEFAULT 1, PRF_MN_FI_DOWNLOAD_PDF_VIS number(1,0) DEFAULT 1, PRF_MN_FI_ADD_DOC_VIS number(1,0) DEFAULT 1, PRF_MN_FI_START_WORKFLOW_VIS number(1,0) DEFAULT 1, PRF_MN_FI_REFRESH_VIS number(1,0) DEFAULT 1, PRF_MN_FI_SCANNER_VIS number(1,0) DEFAULT 1, PRF_MN_FI_UPLOADER_VIS number(1,0) DEFAULT 1, PRF_MN_FI_PURGE_VIS number(1,0) DEFAULT 1, PRF_MN_FI_PURGE_TRASH_VIS number(1,0) DEFAULT 1, PRF_MN_FI_RESTORE_VIS number(1,0) DEFAULT 1, PRF_MN_FI_EXPORT_VIS number(1,0) DEFAULT 1, PRF_MN_FI_CREATE_FROM_TPL_VIS number(1,0) DEFAULT 1, PRF_MN_FI_SEND_DOC_LINK_VIS number(1,0) DEFAULT 1, PRF_MN_FI_SEND_DOC_ATTACH_VIS number(1,0) DEFAULT 1, PRF_MN_ED_LOCK_VIS number(1,0) DEFAULT 1, PRF_MN_ED_UNLOCK_VIS number(1,0) DEFAULT 1, PRF_MN_ED_CIN_VIS number(1,0) DEFAULT 1, PRF_MN_ED_COUT_VIS number(1,0) DEFAULT 1, PRF_MN_ED_CANCEL_COUT_VIS number(1,0) DEFAULT 1, PRF_MN_ED_DELETE_VIS number(1,0) DEFAULT 1, PRF_MN_ED_RENAME_VIS number(1,0) DEFAULT 1, PRF_MN_ED_COPY_VIS number(1,0) DEFAULT 1, PRF_MN_ED_MOVE_VIS number(1,0) DEFAULT 1, PRF_MN_ED_ADD_PROP_GRP_VIS number(1,0) DEFAULT 1, PRF_MN_ED_REM_PROP_GRP_VIS number(1,0) DEFAULT 1, PRF_MN_ED_ADD_SUBS_VIS number(1,0) DEFAULT 1, PRF_MN_ED_REM_SUBS_VIS number(1,0) DEFAULT 1, PRF_MN_BM_MNG_BOOKMARKS_VIS number(1,0) DEFAULT 1, PRF_MN_BM_ADD_BOOKMARK_VIS number(1,0) DEFAULT 1, PRF_MN_BM_SET_HOME_VIS number(1,0) DEFAULT 1, PRF_MN_BM_GO_HOME_VIS number(1,0) DEFAULT 1, PRF_MN_TL_LANGS_VIS number(1,0) DEFAULT 1, PRF_MN_TL_SKIN_VIS number(1,0) DEFAULT 1, PRF_MN_TL_DEBUG_VIS number(1,0) DEFAULT 1, PRF_MN_TL_ADMIN_VIS number(1,0) DEFAULT 1, PRF_MN_TL_PREFS_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_DOC_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_BUG_TRACKING_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_SUPPORT_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_FORUM_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_CHANGELOG_VIS number(1,0) DEFAULT 1, PRF_MN_HLP_WEB_SITE_VIS number(1,0) DEFAULT 1, PRF_MNU_HLP_ABOUT_VIS number(1,0) DEFAULT 1, PRIMARY KEY (PRF_ID));
CREATE TABLE OKM_QUERY_PARAMS (QP_ID number(10,0) NOT NULL, QP_QUERY_NAME varchar2(255) NOT NULL, QP_USER varchar2(127) NOT NULL, QP_NAME varchar2(255), QP_CONTENT varchar2(255), QP_MIME_TYPE varchar2(255), QP_AUTHOR varchar2(255), QP_PATH varchar2(255), QP_DASHBOARD number(1,0), QP_LAST_MODIFIED_FROM date, QP_LAST_MODIFIED_TO date, QP_MAIL_SUBJECT varchar2(255), QP_MAIL_FROM varchar2(255), QP_MAIL_TO varchar2(255), PRIMARY KEY (QP_ID));
CREATE TABLE OKM_QUERY_PARAMS_CATEGORY (QPC_ID number(10,0) NOT NULL, QPC_NAME varchar2(255));
CREATE TABLE OKM_QUERY_PARAMS_KEYWORD (QPK_ID number(10,0) NOT NULL, QPK_NAME varchar2(255));
CREATE TABLE OKM_QUERY_PARAMS_PROPERTY (QPP_ID number(10,0) NOT NULL, QPP_VALUE varchar2(255), QPP_NAME varchar2(255) NOT NULL, PRIMARY KEY (QPP_ID, QPP_NAME));
CREATE TABLE OKM_REPORT (RP_ID number(10,0) NOT NULL, RP_NAME varchar2(255) NOT NULL, RP_TYPE varchar2(255) NOT NULL, RP_FILE_CONTENT clob NOT NULL, RP_FILE_NAME varchar2(255) NOT NULL, RP_ACTIVE number(1,0) NOT NULL, PRIMARY KEY (RP_ID));
CREATE TABLE OKM_ROLE (ROL_ID varchar2(127) NOT NULL, ROL_ACTIVE number(1,0) NOT NULL, PRIMARY KEY (ROL_ID));
CREATE TABLE OKM_STAPLE (ST_ID number(10,0) NOT NULL, ST_UUID varchar2(255) NOT NULL, ST_TYPE varchar2(255) NOT NULL, ST_GROUPID number(10,0), PRIMARY KEY (ST_ID));
CREATE TABLE OKM_STAPLE_GROUP (SG_ID number(10,0) NOT NULL, SG_USER varchar2(127) NOT NULL, PRIMARY KEY (SG_ID));
CREATE TABLE OKM_TWITTER_ACCOUNT (TA_ID number(10,0) NOT NULL, TA_USER varchar2(127) NOT NULL, TA_TUSER varchar2(255) NOT NULL, TA_ACTIVE number(1,0) NOT NULL, PRIMARY KEY (TA_ID));
CREATE TABLE OKM_USER (USR_ID varchar2(127) NOT NULL, USR_NAME varchar2(255) NOT NULL, USR_PASSWORD varchar2(255) NOT NULL, USR_EMAIL varchar2(255) NOT NULL, USR_ACTIVE number(1,0) NOT NULL, PRIMARY KEY (USR_ID));
CREATE TABLE OKM_USER_CONFIG (UC_USER varchar2(127) NOT NULL, UC_HOME_PATH varchar2(255) NOT NULL, UC_HOME_UUID varchar2(255) NOT NULL, UC_HOME_TYPE varchar2(255) NOT NULL, UC_PROFILE number(10,0), PRIMARY KEY (UC_USER));
CREATE TABLE OKM_USER_DOCUMENT (UD_ID number(10,0) NOT NULL, UD_USER varchar2(255) NOT NULL, UD_DOCUMENT varchar2(255) NOT NULL, PRIMARY KEY (UD_ID));
CREATE TABLE OKM_USER_DOCUMENT_KEYWORD (UDK_ID number(10,0) NOT NULL, UDK_NAME varchar2(255));
CREATE TABLE OKM_USER_ITEMS (UI_USER varchar2(255) NOT NULL, UI_FOLDERS number(10,0), UI_DOCUMENTS number(10,0), UI_MAILS number(10,0), UI_SIZE number(19,0), PRIMARY KEY (UI_USER));
CREATE TABLE OKM_USER_ROLE (UR_USER varchar2(127) NOT NULL, UR_ROLE varchar2(127) NOT NULL, PRIMARY KEY (UR_USER, UR_ROLE));
CREATE INDEX IDX_ACTION_ACTNDL ON JBPM_ACTION (ACTIONDELEGATION_);
CREATE INDEX IDX_ACTION_PROCDF ON JBPM_ACTION (PROCESSDEFINITION_);
CREATE INDEX IDX_ACTION_EVENT ON JBPM_ACTION (EVENT_);
ALTER TABLE JBPM_ACTION ADD constraint FK_ACTION_REFACT FOREIGN KEY (REFERENCEDACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_ACTION ADD constraint FK_CRTETIMERACT_TA FOREIGN KEY (TIMERACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_ACTION ADD constraint FK_ACTION_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_ACTION ADD constraint FK_ACTION_EVENT FOREIGN KEY (EVENT_) REFERENCES JBPM_EVENT;
ALTER TABLE JBPM_ACTION ADD constraint FK_ACTION_ACTNDEL FOREIGN KEY (ACTIONDELEGATION_) REFERENCES JBPM_DELEGATION;
ALTER TABLE JBPM_ACTION ADD constraint FK_ACTION_EXPTHDL FOREIGN KEY (EXCEPTIONHANDLER_) REFERENCES JBPM_EXCEPTIONHANDLER;
ALTER TABLE JBPM_BYTEARRAY ADD constraint FK_BYTEARR_FILDEF FOREIGN KEY (FILEDEFINITION_) REFERENCES JBPM_MODULEDEFINITION;
ALTER TABLE JBPM_BYTEBLOCK ADD constraint FK_BYTEBLOCK_FILE FOREIGN KEY (PROCESSFILE_) REFERENCES JBPM_BYTEARRAY;
CREATE INDEX IDX_COMMENT_TSK ON JBPM_COMMENT (TASKINSTANCE_);
CREATE INDEX IDX_COMMENT_TOKEN ON JBPM_COMMENT (TOKEN_);
ALTER TABLE JBPM_COMMENT ADD constraint FK_COMMENT_TOKEN FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_COMMENT ADD constraint FK_COMMENT_TSK FOREIGN KEY (TASKINSTANCE_) REFERENCES JBPM_TASKINSTANCE;
ALTER TABLE JBPM_DECISIONCONDITIONS ADD constraint FK_DECCOND_DEC FOREIGN KEY (DECISION_) REFERENCES JBPM_NODE;
CREATE INDEX IDX_DELEG_PRCD ON JBPM_DELEGATION (PROCESSDEFINITION_);
ALTER TABLE JBPM_DELEGATION ADD constraint FK_DELEGATION_PRCD FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_EVENT ADD constraint FK_EVENT_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_EVENT ADD constraint FK_EVENT_TRANS FOREIGN KEY (TRANSITION_) REFERENCES JBPM_TRANSITION;
ALTER TABLE JBPM_EVENT ADD constraint FK_EVENT_NODE FOREIGN KEY (NODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_EVENT ADD constraint FK_EVENT_TASK FOREIGN KEY (TASK_) REFERENCES JBPM_TASK;
CREATE INDEX IDX_JOB_TSKINST ON JBPM_JOB (TASKINSTANCE_);
CREATE INDEX IDX_JOB_TOKEN ON JBPM_JOB (TOKEN_);
CREATE INDEX IDX_JOB_PRINST ON JBPM_JOB (PROCESSINSTANCE_);
ALTER TABLE JBPM_JOB ADD constraint FK_JOB_PRINST FOREIGN KEY (PROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_JOB ADD constraint FK_JOB_ACTION FOREIGN KEY (ACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_JOB ADD constraint FK_JOB_TOKEN FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_JOB ADD constraint FK_JOB_NODE FOREIGN KEY (NODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_JOB ADD constraint FK_JOB_TSKINST FOREIGN KEY (TASKINSTANCE_) REFERENCES JBPM_TASKINSTANCE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_SOURCENODE FOREIGN KEY (SOURCENODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_DESTNODE FOREIGN KEY (DESTINATIONNODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_TOKEN FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_TRANSITION FOREIGN KEY (TRANSITION_) REFERENCES JBPM_TRANSITION;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_TASKINST FOREIGN KEY (TASKINSTANCE_) REFERENCES JBPM_TASKINSTANCE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_CHILDTOKEN FOREIGN KEY (CHILD_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_OLDBYTES FOREIGN KEY (OLDBYTEARRAY_) REFERENCES JBPM_BYTEARRAY;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_SWIMINST FOREIGN KEY (SWIMLANEINSTANCE_) REFERENCES JBPM_SWIMLANEINSTANCE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_NEWBYTES FOREIGN KEY (NEWBYTEARRAY_) REFERENCES JBPM_BYTEARRAY;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_ACTION FOREIGN KEY (ACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_VARINST FOREIGN KEY (VARIABLEINSTANCE_) REFERENCES JBPM_VARIABLEINSTANCE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_NODE FOREIGN KEY (NODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_LOG ADD constraint FK_LOG_PARENT FOREIGN KEY (PARENT_) REFERENCES JBPM_LOG;
CREATE INDEX IDX_MODDEF_PROCDF ON JBPM_MODULEDEFINITION (PROCESSDEFINITION_);
ALTER TABLE JBPM_MODULEDEFINITION ADD constraint FK_MODDEF_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_MODULEDEFINITION ADD constraint FK_TSKDEF_START FOREIGN KEY (STARTTASK_) REFERENCES JBPM_TASK;
CREATE INDEX IDX_MODINST_PRINST ON JBPM_MODULEINSTANCE (PROCESSINSTANCE_);
ALTER TABLE JBPM_MODULEINSTANCE ADD constraint FK_MODINST_PRCINST FOREIGN KEY (PROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_MODULEINSTANCE ADD constraint FK_TASKMGTINST_TMD FOREIGN KEY (TASKMGMTDEFINITION_) REFERENCES JBPM_MODULEDEFINITION;
CREATE INDEX IDX_PSTATE_SBPRCDEF ON JBPM_NODE (SUBPROCESSDEFINITION_);
CREATE INDEX IDX_NODE_PROCDEF ON JBPM_NODE (PROCESSDEFINITION_);
CREATE INDEX IDX_NODE_ACTION ON JBPM_NODE (ACTION_);
CREATE INDEX IDX_NODE_SUPRSTATE ON JBPM_NODE (SUPERSTATE_);
ALTER TABLE JBPM_NODE ADD constraint FK_DECISION_DELEG FOREIGN KEY (DECISIONDELEGATION) REFERENCES JBPM_DELEGATION;
ALTER TABLE JBPM_NODE ADD constraint FK_NODE_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_NODE ADD constraint FK_NODE_ACTION FOREIGN KEY (ACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_NODE ADD constraint FK_PROCST_SBPRCDEF FOREIGN KEY (SUBPROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_NODE ADD constraint FK_NODE_SCRIPT FOREIGN KEY (SCRIPT_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_NODE ADD constraint FK_NODE_SUPERSTATE FOREIGN KEY (SUPERSTATE_) REFERENCES JBPM_NODE;
CREATE INDEX IDX_TSKINST_SWLANE ON JBPM_POOLEDACTOR (SWIMLANEINSTANCE_);
CREATE INDEX IDX_PLDACTR_ACTID ON JBPM_POOLEDACTOR (ACTORID_);
ALTER TABLE JBPM_POOLEDACTOR ADD constraint FK_POOLEDACTOR_SLI FOREIGN KEY (SWIMLANEINSTANCE_) REFERENCES JBPM_SWIMLANEINSTANCE;
CREATE INDEX IDX_PROCDEF_STRTST ON JBPM_PROCESSDEFINITION (STARTSTATE_);
ALTER TABLE JBPM_PROCESSDEFINITION ADD constraint FK_PROCDEF_STRTSTA FOREIGN KEY (STARTSTATE_) REFERENCES JBPM_NODE;
CREATE INDEX IDX_PROCIN_SPROCTK ON JBPM_PROCESSINSTANCE (SUPERPROCESSTOKEN_);
CREATE INDEX IDX_PROCIN_ROOTTK ON JBPM_PROCESSINSTANCE (ROOTTOKEN_);
CREATE INDEX IDX_PROCIN_PROCDEF ON JBPM_PROCESSINSTANCE (PROCESSDEFINITION_);
CREATE INDEX IDX_PROCIN_KEY ON JBPM_PROCESSINSTANCE (KEY_);
ALTER TABLE JBPM_PROCESSINSTANCE ADD constraint FK_PROCIN_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_PROCESSINSTANCE ADD constraint FK_PROCIN_ROOTTKN FOREIGN KEY (ROOTTOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_PROCESSINSTANCE ADD constraint FK_PROCIN_SPROCTKN FOREIGN KEY (SUPERPROCESSTOKEN_) REFERENCES JBPM_TOKEN;
CREATE INDEX IDX_RTACTN_ACTION ON JBPM_RUNTIMEACTION (ACTION_);
CREATE INDEX IDX_RTACTN_PRCINST ON JBPM_RUNTIMEACTION (PROCESSINSTANCE_);
ALTER TABLE JBPM_RUNTIMEACTION ADD constraint FK_RTACTN_PROCINST FOREIGN KEY (PROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_RUNTIMEACTION ADD constraint FK_RTACTN_ACTION FOREIGN KEY (ACTION_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_SWIMLANE ADD constraint FK_SWL_ASSDEL FOREIGN KEY (ASSIGNMENTDELEGATION_) REFERENCES JBPM_DELEGATION;
ALTER TABLE JBPM_SWIMLANE ADD constraint FK_SWL_TSKMGMTDEF FOREIGN KEY (TASKMGMTDEFINITION_) REFERENCES JBPM_MODULEDEFINITION;
CREATE INDEX IDX_SWIMLINST_SL ON JBPM_SWIMLANEINSTANCE (SWIMLANE_);
ALTER TABLE JBPM_SWIMLANEINSTANCE ADD constraint FK_SWIMLANEINST_TM FOREIGN KEY (TASKMGMTINSTANCE_) REFERENCES JBPM_MODULEINSTANCE;
ALTER TABLE JBPM_SWIMLANEINSTANCE ADD constraint FK_SWIMLANEINST_SL FOREIGN KEY (SWIMLANE_) REFERENCES JBPM_SWIMLANE;
CREATE INDEX IDX_TASK_PROCDEF ON JBPM_TASK (PROCESSDEFINITION_);
CREATE INDEX IDX_TASK_TSKNODE ON JBPM_TASK (TASKNODE_);
CREATE INDEX IDX_TASK_TASKMGTDF ON JBPM_TASK (TASKMGMTDEFINITION_);
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_STARTST FOREIGN KEY (STARTSTATE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_ASSDEL FOREIGN KEY (ASSIGNMENTDELEGATION_) REFERENCES JBPM_DELEGATION;
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_SWIMLANE FOREIGN KEY (SWIMLANE_) REFERENCES JBPM_SWIMLANE;
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_TASKNODE FOREIGN KEY (TASKNODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_TASK ADD constraint FK_TASK_TASKMGTDEF FOREIGN KEY (TASKMGMTDEFINITION_) REFERENCES JBPM_MODULEDEFINITION;
ALTER TABLE JBPM_TASK ADD constraint FK_TSK_TSKCTRL FOREIGN KEY (TASKCONTROLLER_) REFERENCES JBPM_TASKCONTROLLER;
ALTER TABLE JBPM_TASKACTORPOOL ADD constraint FK_TASKACTPL_TSKI FOREIGN KEY (TASKINSTANCE_) REFERENCES JBPM_TASKINSTANCE;
ALTER TABLE JBPM_TASKACTORPOOL ADD constraint FK_TSKACTPOL_PLACT FOREIGN KEY (POOLEDACTOR_) REFERENCES JBPM_POOLEDACTOR;
ALTER TABLE JBPM_TASKCONTROLLER ADD constraint FK_TSKCTRL_DELEG FOREIGN KEY (TASKCONTROLLERDELEGATION_) REFERENCES JBPM_DELEGATION;
CREATE INDEX IDX_TSKINST_TMINST ON JBPM_TASKINSTANCE (TASKMGMTINSTANCE_);
CREATE INDEX IDX_TSKINST_SLINST ON JBPM_TASKINSTANCE (SWIMLANINSTANCE_);
CREATE INDEX IDX_TASKINST_TOKN ON JBPM_TASKINSTANCE (TOKEN_);
CREATE INDEX IDX_TASK_ACTORID ON JBPM_TASKINSTANCE (ACTORID_);
CREATE INDEX IDX_TASKINST_TSK ON JBPM_TASKINSTANCE (TASK_, PROCINST_);
ALTER TABLE JBPM_TASKINSTANCE ADD constraint FK_TSKINS_PRCINS FOREIGN KEY (PROCINST_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_TASKINSTANCE ADD constraint FK_TASKINST_TMINST FOREIGN KEY (TASKMGMTINSTANCE_) REFERENCES JBPM_MODULEINSTANCE;
ALTER TABLE JBPM_TASKINSTANCE ADD constraint FK_TASKINST_TOKEN FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_TASKINSTANCE ADD constraint FK_TASKINST_SLINST FOREIGN KEY (SWIMLANINSTANCE_) REFERENCES JBPM_SWIMLANEINSTANCE;
ALTER TABLE JBPM_TASKINSTANCE ADD constraint FK_TASKINST_TASK FOREIGN KEY (TASK_) REFERENCES JBPM_TASK;
CREATE INDEX IDX_TOKEN_PARENT ON JBPM_TOKEN (PARENT_);
CREATE INDEX IDX_TOKEN_PROCIN ON JBPM_TOKEN (PROCESSINSTANCE_);
CREATE INDEX IDX_TOKEN_NODE ON JBPM_TOKEN (NODE_);
CREATE INDEX IDX_TOKEN_SUBPI ON JBPM_TOKEN (SUBPROCESSINSTANCE_);
ALTER TABLE JBPM_TOKEN ADD constraint FK_TOKEN_SUBPI FOREIGN KEY (SUBPROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_TOKEN ADD constraint FK_TOKEN_PROCINST FOREIGN KEY (PROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_TOKEN ADD constraint FK_TOKEN_NODE FOREIGN KEY (NODE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_TOKEN ADD constraint FK_TOKEN_PARENT FOREIGN KEY (PARENT_) REFERENCES JBPM_TOKEN;
CREATE INDEX IDX_TKVVARMP_TOKEN ON JBPM_TOKENVARIABLEMAP (TOKEN_);
CREATE INDEX IDX_TKVARMAP_CTXT ON JBPM_TOKENVARIABLEMAP (CONTEXTINSTANCE_);
ALTER TABLE JBPM_TOKENVARIABLEMAP ADD constraint FK_TKVARMAP_TOKEN FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_TOKENVARIABLEMAP ADD constraint FK_TKVARMAP_CTXT FOREIGN KEY (CONTEXTINSTANCE_) REFERENCES JBPM_MODULEINSTANCE;
CREATE INDEX IDX_TRANS_PROCDEF ON JBPM_TRANSITION (PROCESSDEFINITION_);
CREATE INDEX IDX_TRANSIT_FROM ON JBPM_TRANSITION (FROM_);
CREATE INDEX IDX_TRANSIT_TO ON JBPM_TRANSITION (TO_);
ALTER TABLE JBPM_TRANSITION ADD constraint FK_TRANSITION_FROM FOREIGN KEY (FROM_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_TRANSITION ADD constraint FK_TRANS_PROCDEF FOREIGN KEY (PROCESSDEFINITION_) REFERENCES JBPM_PROCESSDEFINITION;
ALTER TABLE JBPM_TRANSITION ADD constraint FK_TRANSITION_TO FOREIGN KEY (TO_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_VARIABLEACCESS ADD constraint FK_VARACC_PROCST FOREIGN KEY (PROCESSSTATE_) REFERENCES JBPM_NODE;
ALTER TABLE JBPM_VARIABLEACCESS ADD constraint FK_VARACC_SCRIPT FOREIGN KEY (SCRIPT_) REFERENCES JBPM_ACTION;
ALTER TABLE JBPM_VARIABLEACCESS ADD constraint FK_VARACC_TSKCTRL FOREIGN KEY (TASKCONTROLLER_) REFERENCES JBPM_TASKCONTROLLER;
CREATE INDEX IDX_VARINST_TK ON JBPM_VARIABLEINSTANCE (TOKEN_);
CREATE INDEX IDX_VARINST_TKVARMP ON JBPM_VARIABLEINSTANCE (TOKENVARIABLEMAP_);
CREATE INDEX IDX_VARINST_PRCINS ON JBPM_VARIABLEINSTANCE (PROCESSINSTANCE_);
ALTER TABLE JBPM_VARIABLEINSTANCE ADD constraint FK_VARINST_PRCINST FOREIGN KEY (PROCESSINSTANCE_) REFERENCES JBPM_PROCESSINSTANCE;
ALTER TABLE JBPM_VARIABLEINSTANCE ADD constraint FK_VARINST_TKVARMP FOREIGN KEY (TOKENVARIABLEMAP_) REFERENCES JBPM_TOKENVARIABLEMAP;
ALTER TABLE JBPM_VARIABLEINSTANCE ADD constraint FK_VARINST_TK FOREIGN KEY (TOKEN_) REFERENCES JBPM_TOKEN;
ALTER TABLE JBPM_VARIABLEINSTANCE ADD constraint FK_BYTEINST_ARRAY FOREIGN KEY (BYTEARRAYVALUE_) REFERENCES JBPM_BYTEARRAY;
ALTER TABLE JBPM_VARIABLEINSTANCE ADD constraint FK_VAR_TSKINST FOREIGN KEY (TASKINSTANCE_) REFERENCES JBPM_TASKINSTANCE;
ALTER TABLE OKM_FILTER_RULE ADD constraint FKCC0FA2157CF377A9 FOREIGN KEY (FR_MAIL_FILTER) REFERENCES OKM_MAIL_FILTER;
ALTER TABLE OKM_MAIL_FILTER ADD constraint FK89DD61B2D99BBF14 FOREIGN KEY (MF_MAIL_ACCOUNT) REFERENCES OKM_MAIL_ACCOUNT;
ALTER TABLE OKM_MIME_TYPE_EXTENSION ADD constraint FK198BAD77C645F9B7 FOREIGN KEY (MTE_ID) REFERENCES OKM_MIME_TYPE;
ALTER TABLE OKM_QUERY_PARAMS_CATEGORY ADD constraint FKE27BE632200C4397 FOREIGN KEY (QPC_ID) REFERENCES OKM_QUERY_PARAMS;
ALTER TABLE OKM_QUERY_PARAMS_KEYWORD ADD constraint FK4A477A15200FE68F FOREIGN KEY (QPK_ID) REFERENCES OKM_QUERY_PARAMS;
ALTER TABLE OKM_QUERY_PARAMS_PROPERTY ADD constraint FKA447070920122C6A FOREIGN KEY (QPP_ID) REFERENCES OKM_QUERY_PARAMS;
ALTER TABLE OKM_STAPLE ADD constraint FK45419DD7E6CC0B56 FOREIGN KEY (ST_GROUPID) REFERENCES OKM_STAPLE_GROUP;
ALTER TABLE OKM_USER_CONFIG ADD constraint FK7798F4E88FDAFE34 FOREIGN KEY (UC_PROFILE) REFERENCES OKM_PROFILE;
ALTER TABLE OKM_USER_DOCUMENT_KEYWORD ADD constraint FK7A93ECCB47DCC8C7 FOREIGN KEY (UDK_ID) REFERENCES OKM_USER_DOCUMENT;
ALTER TABLE OKM_USER_ROLE ADD constraint FK79C279CF1C15945 FOREIGN KEY (UR_USER) REFERENCES OKM_USER;
ALTER TABLE OKM_USER_ROLE ADD constraint FK79C279CF1BE829B FOREIGN KEY (UR_ROLE) REFERENCES OKM_ROLE;
CREATE sequence hibernate_sequence;
