-- 表单模块
CREATE INDEX IDX_BO_ATTR_ENT_ID ON FORM_BO_ATTR (ENT_ID_);
CREATE INDEX IDX_BO_ENT_TABLE_NAME ON FORM_BO_ENT (TABLE_NAME_);
CREATE INDEX IDX_BO_RELATION_BO_DEF_ID ON FORM_BO_RELATION (BO_DEF_ID_);
CREATE INDEX IDX_BO_RELATION_FORM_ID ON FORM_BO_RELATION (FORM_ID_);
CREATE INDEX IDX_BUS_SET_FORM_KEY ON FORM_BUS_SET (FORM_KEY_);
CREATE INDEX IDX_COMBINATE_DIALOG_ALIAS ON FORM_COMBINATE_DIALOG (ALIAS_);
CREATE INDEX IDX_CUSTOM_CHART_ALIAS ON FORM_CUSTOM_CHART (ALIAS_);
CREATE INDEX IDX_DEFINITION_DEF_ID ON FORM_DEFINITION (DEF_ID_);
CREATE INDEX IDX_DEFINITION_FORM_KEY ON FORM_DEFINITION (FORM_KEY_);
CREATE INDEX IDX_CUSTOM_DIALOG_ALIAS ON FORM_CUSTOM_DIALOG (ALIAS_);
CREATE INDEX IDX_DATA_IMPORT_LOG_P_ID ON FORM_DATA_IMPORT_LOG (P_ID_);
CREATE INDEX IDX_DATA_IMPORT_LOG_BO_ALIAS ON FORM_DATA_IMPORT_LOG (BO_ALIAS_);
CREATE INDEX IDX_DATA_TEMPLATE_ALIAS ON FORM_DATA_TEMPLATE (ALIAS_);
CREATE INDEX IDX_FIELD_BO_DEF_ID ON FORM_FIELD (BO_DEF_ID_);
CREATE INDEX IDX_FIELD_AUTH_ENT_NAME ON FORM_FIELD_AUTH (ENT_NAME_);
CREATE INDEX IDX_FIELD_AUTH_CLASS_NAME ON FORM_FIELD_AUTH (CLASS_NAME_);
CREATE INDEX IDX_FIELD_AUTH_TABLE_NAME ON FORM_FIELD_AUTH (TABLE_NAME_);
CREATE INDEX IDX_HISTORY_RECORD_FORM_ID ON FORM_HISTORY_RECORD (FORM_ID_);
CREATE INDEX IDX_META_KEY ON FORM_META (KEY_);
CREATE INDEX IDX_TEMPLATE_TEMPLATE_TYPE ON FORM_TEMPLATE (TEMPLATE_TYPE_);
CREATE INDEX IDX_TEMPLATE_ALIAS ON FORM_TEMPLATE (ALIAS_);
CREATE INDEX IDX_RIGHT_FLOW_KEY ON FORM_RIGHT (FLOW_KEY_);
CREATE INDEX IDX_RIGHT_FORM_KEY ON FORM_RIGHT (FORM_KEY_);
CREATE INDEX IDX_QUERY_VIEW_SQL_ALIAS ON FORM_QUERY_VIEW (SQL_ALIAS_);
CREATE INDEX IDX_QUERY_VIEW_ALIAS ON FORM_QUERY_VIEW (ALIAS_);
CREATE INDEX IDX_QUERY_METAFIELD_SQL_ID ON FORM_QUERY_METAFIELD (SQL_ID_);
CREATE INDEX IDX_CUSTOM_QUERY_ALIAS ON FORM_CUSTOM_QUERY (ALIAS_);
 
-- 门户模块
CREATE INDEX IDX_APP_TAGS_RELATION_TAG_ID ON PORTAL_APP_TAGS_RELATION (TAG_ID_);
CREATE INDEX IDX_CAL_ASSIGN_CANLENDAR_ID ON PORTAL_CAL_ASSIGN (CANLENDAR_ID_);
CREATE INDEX IDX_CAL_SETTING_CALENDAR_ID ON PORTAL_CAL_SETTING (CALENDAR_ID_);
CREATE INDEX IDX_CAL_SHIFT_PEROID_SHIFT_ID ON PORTAL_CAL_SHIFT_PEROID (SHIFT_ID_);
CREATE INDEX IDX_I18N_MESSAGE_KEY ON PORTAL_I18N_MESSAGE (KEY_);
CREATE INDEX IDX_I18N_MESSAGE_TYPE_TYPE ON PORTAL_I18N_MESSAGE_TYPE (TYPE_);
CREATE INDEX IDX_NEWS_NOTICE__CREATE_BY ON PORTAL_NEWS_NOTICE_ (CREATE_BY_);
CREATE INDEX IDX_NEWS_NOTICE__CLASSIFY_ID ON PORTAL_NEWS_NOTICE_ (CLASSIFY_ID_);
CREATE INDEX IDX_NEWS_TREE_PARENT_ID ON PORTAL_NEWS_TREE_ (PARENT_ID_);
CREATE INDEX IDX_SERVICE_PARAM_SET_ID ON PORTAL_SERVICE_PARAM (SET_ID_);
CREATE INDEX IDX_SYS_APP_MENU_ID ON PORTAL_SYS_APP (MENU_ID_);
CREATE INDEX IDX_SYS_AUTH_USER_OWNER_ID ON PORTAL_SYS_AUTH_USER (OWNER_ID_);
CREATE INDEX IDX_SYS_COLUMN_ALIAS ON PORTAL_SYS_COLUMN (ALIAS);
CREATE INDEX IDX_SYS_DATASOURCE_ALIAS ON PORTAL_SYS_DATASOURCE (ALIAS_);
CREATE INDEX IDX_SYS_DIC_TYPE_ID ON PORTAL_SYS_DIC (TYPE_ID_);
CREATE INDEX IDX_SYS_EXTERNAL_UNITE_TYPE ON PORTAL_SYS_EXTERNAL_UNITE (TYPE_);
CREATE INDEX IDX_SYS_FILE_CLASSIFY_PARENTID ON PORTAL_SYS_FILE_CLASSIFY (PARENTID);
CREATE INDEX IDX_SYS_IDENTITY_ALIAS ON PORTAL_SYS_IDENTITY (ALIAS_);
CREATE INDEX IDX_SYS_LAYOUT_MANAGE_ORG_ID ON PORTAL_SYS_LAYOUT_MANAGE (ORG_ID);
CREATE INDEX IDX_SYS_LAY_SET_LAYOUT_ID ON PORTAL_SYS_LAYOUT_SETTING (LAYOUT_ID_);
CREATE INDEX IDX_SYS_LAYOUT_TOOLS_LAYOUT_ID ON PORTAL_SYS_LAYOUT_TOOLS (LAYOUT_ID_);
CREATE INDEX IDX_SYS_MAIL_SET_ID ON PORTAL_SYS_MAIL (SET_ID_);
CREATE INDEX IDX_SYS_MAIL_USER_ID ON PORTAL_SYS_MAIL (USER_ID_);
CREATE INDEX IDX_SYS_MAIL_ATT_MAILID ON PORTAL_SYS_MAIL_ATTACHEMENT (MAILID);
CREATE INDEX IDX_SYS_MAIL_LINKMAN_MAILID ON PORTAL_SYS_MAIL_LINKMAN (MAILID);
CREATE INDEX IDX_SYS_MAIL_SETTING_USER_ID ON PORTAL_SYS_MAIL_SETTING (USER_ID_);
CREATE INDEX IDX_SYS_MENU_PARENT_ID ON PORTAL_SYS_MENU (PARENT_ID_);
CREATE INDEX IDX_SYS_MENU_ALIAS ON PORTAL_SYS_MENU (ALIAS_);
CREATE INDEX IDX_SYS_MODULE_CODE ON PORTAL_SYS_MODULE (CODE_);
CREATE INDEX IDX_SYS_MSG_READ_MSG_ID ON PORTAL_SYS_MSG_READ (MSG_ID_);
CREATE INDEX IDX_SYS_MSG_READ_RECEIVER_ID ON PORTAL_SYS_MSG_READ (RECEIVER_ID_);
CREATE INDEX IDX_SYS_MSG_RECEIVER_MSG_ID ON PORTAL_SYS_MSG_RECEIVER (MSG_ID_);
CREATE INDEX IDX_SYS_MSG_REC_REC_ID ON PORTAL_SYS_MSG_RECEIVER (RECEIVER_ID_);
CREATE INDEX IDX_SYS_MSG_TPL_KEY ON PORTAL_SYS_MSG_TPL (KEY_);
CREATE INDEX IDX_SYS_MY_LAYOUT_USER_ID ON PORTAL_SYS_MY_LAYOUT (USER_ID);
CREATE INDEX IDX_SYS_TAG_TYPEID ON PORTAL_SYS_TAG (TYPE_ID_);
CREATE INDEX IDX_SYS_PROPERTIES_ALIAS ON PORTAL_SYS_PROPERTIES (ALIAS);
 
-- 流程
CREATE INDEX ACT_IDX_EVENT_PROCINSTID ON ACT_RU_EVENT_SUBSCR (PROC_INST_ID_);
CREATE INDEX ACT_IDX_RUEXECUTION_PROCINSTID ON ACT_RU_EXECUTION (PROC_INST_ID_);  
CREATE INDEX ACR_IDX_RUEXECUTION_PARENTID ON ACT_RU_EXECUTION (PARENT_ID_);
CREATE INDEX ACT_IDX_RUTASK_PROCINSTID ON ACT_RU_TASK (PROC_INST_ID_);
CREATE INDEX IDX_AGENT_SETTINGID ON BPM_AGENT_CONDITION (SETTING_ID_);
CREATE INDEX IDX_AGENTDEF_FLOWKEY ON BPM_AGENT_DEF (FLOW_KEY_);
CREATE INDEX IDX_AGENTSETTING_AUTHID ON BPM_AGENT_SETTING (AUTH_ID_);   
CREATE INDEX IDX_AGENTSETTING_TYPE ON BPM_AGENT_SETTING (TYPE_);
CREATE INDEX IDX_AGENTSETTING_ISENABLED ON BPM_AGENT_SETTING (IS_ENABLED_);
CREATE INDEX IDX_AGENTSETTING_FLOWKEY ON BPM_AGENT_SETTING (FLOW_KEY_);
CREATE INDEX IDX_APPROVALITEM_USERID ON BPM_APPROVAL_ITEM (USER_ID_); 
CREATE INDEX IDX_APPROVALITEM_TYPE ON BPM_APPROVAL_ITEM (TYPE_);
CREATE INDEX IDX_CALLLOG_CALLTIME ON BPM_CALL_LOG (CALL_TIME_);
CREATE INDEX IDX_OPINIONHI_PROCINSTID ON BPM_CHECK_OPINION_HI (PROC_INST_ID_); 
CREATE INDEX IDX_COMMURECEIVER_COMMUID ON BPM_COMMU_RECEIVER (COMMU_ID_);
CREATE INDEX IDX_COMMURECEIVER_RECEIVERID ON BPM_COMMU_RECEIVER (RECEIVER_ID_);
CREATE INDEX IDX_CPTORECEIVER_RECEIVERID ON BPM_CPTO_RECEIVER (RECEIVER_ID_);   
CREATE INDEX IDX_CUSTOM_SIGN_TASKID ON BPM_CUSTOM_SIGNDATA (TASK_ID_);
CREATE INDEX IDX_CUSTOM_SIGN_INSTID ON BPM_CUSTOM_SIGNDATA (INST_ID_);
CREATE INDEX IDX_AUTHTYPE_AUTHTYPE ON BPM_DEF_AUTH_TYPE (AUTHORIZE_TYPE_); 
CREATE INDEX IDX_DEFUSER_RIGHTTYPE ON BPM_DEF_USER (RIGHT_TYPE_);
CREATE INDEX IDX_DEFUSER_OBJTYPE ON BPM_DEF_USER (OBJ_TYPE_);  
CREATE INDEX IDX_DEFINITION_DEFKEY ON BPM_DEFINITION (DEF_KEY_);
CREATE INDEX IDX_DEFINITION_BPMNDEFID ON BPM_DEFINITION (BPMN_DEF_ID_);  
CREATE INDEX IDX_DEPUTY_USERID ON BPM_DEPUTY (USER_ID_);
CREATE INDEX IDX_DEPUTY_AGENTID ON BPM_DEPUTY (AGENT_ID_);
CREATE INDEX IDX_MULTISCRIPT_ALIASNAME ON BPM_MULTI_SCRIPT (ALIAS_NAME_);
CREATE INDEX IDX_OFTENFLOW_DEFKEY ON BPM_OFTEN_FLOW (DEF_KEY_);
CREATE INDEX IDX_OFTENFLOW_USERID ON BPM_OFTEN_FLOW (USER_ID_);
CREATE INDEX IDX_OFTENFLOWUSER_OFTENFLOWID ON BPM_OFTEN_FLOW_USER (OFTEN_FLOW_ID_);
CREATE INDEX IDX_PRINTRECORD_PROCINSTID ON BPM_PRINT_RECORD (PROC_INST_ID_);
CREATE INDEX IDX_PROBO_PROCESSID ON BPM_PRO_BO (PROCESS_ID_);
CREATE INDEX IDX_PROBO_BOCODE ON BPM_PRO_BO (BO_CODE_);
CREATE INDEX IDX_PRO_INST_PROCDEFKEY ON BPM_PRO_INST (PROC_DEF_KEY_);
CREATE INDEX IDX_PRO_INST_PROCDEFID ON BPM_PRO_INST (PROC_DEF_ID_);
CREATE INDEX IDX_PROINSTSTATUS_KEY ON BPM_PRO_INST_STATUS (KEY_);
CREATE INDEX IDX_PROSTATUS_NODEID ON BPM_PRO_STATUS (NODE_ID_);
CREATE INDEX IDX_PROSTATUSHI_NODEID ON BPM_PRO_STATUS_HI (NODE_ID_);
CREATE INDEX IDX_READRECORD_PROCINSTID ON BPM_READ_RECORD (PROC_INST_ID_);
CREATE INDEX IDX_READRECORD_TASKID ON BPM_READ_RECORD (TASK_ID_);
CREATE INDEX IDX_READRECORD_TASKKEY ON BPM_READ_RECORD (TASK_KEY_);
CREATE INDEX IDX_REPORTACT_REPORTID ON BPM_REPORT_ACT (REPORT_ID_);
CREATE INDEX IDX_REPORTUSER_REPORTID ON BPM_REPORT_USER (REPORT_ID_);
CREATE INDEX IDX_SAVEOPINION_PROCINSTID ON BPM_SAVE_OPINION (PROC_INST_ID_);
CREATE INDEX IDX_SAVEOPINION_TASKID ON BPM_SAVE_OPINION (TASK_ID_);
CREATE INDEX IDX_SCRIPT_NAME ON BPM_SCRIPT (NAME_);
CREATE INDEX IDX_SEC_SECRETARYID ON BPM_SECRETARY_MANAGE (SECRETARY_ID_);
CREATE INDEX IDX_SELECTORDEF_ALIAS ON BPM_SELECTOR_DEF (ALIAS_);
CREATE INDEX IDX_TASKCANDIDATE_PROCINSTID ON BPM_TASK_CANDIDATE (PROC_INST_ID_);
CREATE INDEX IDX_TASKCOMMU_TASKID ON BPM_TASK_COMMU (TASK_ID_);
CREATE INDEX IDX_TASKCOMMU_INSTANCEID ON BPM_TASK_COMMU (INSTANCE_ID_);
CREATE INDEX IDX_WATE_TYPE_WMA_ID ON BPM_WATERMARK_TYPE (WATERMARK_ID_);
CREATE INDEX IDX_TRANS_REC_TRANS_RDID ON BPM_TRANS_RECEIVER (TRANS_RECORDID_);
CREATE INDEX IDX_TASK_TURN_TASK_TURN_ID ON BPM_TASK_TURNASSIGN (TASK_TURN_ID_);
CREATE INDEX IDX_TASK_TRANS_RECT_ID ON BPM_TASK_TRANS_RECORD (TASK_ID_);
CREATE INDEX IDX_TASK_TRANS_TASK_ID ON BPM_TASK_TRANS (TASK_ID_);
CREATE INDEX IDX_TASK_TRANS_INSTANCE_ID ON BPM_TASK_TRANS (INSTANCE_ID_);
CREATE INDEX IDX_TASK_SIGNDATA_EXECUTE_ID ON BPM_TASK_SIGNDATA (EXECUTE_ID_);
CREATE INDEX IDX_TASK_SIGNDATA_NODE_ID ON BPM_TASK_SIGNDATA (NODE_ID_);
CREATE INDEX IDX_TASK_SIGN_SEQ_INST_ID ON BPM_TASK_SIGN_SEQUENCE (INSTANCE_ID_);
CREATE INDEX IDX_TASK_SIGN_SEQUENCE_TASK_ID ON BPM_TASK_SIGN_SEQUENCE (TASK_ID_);
CREATE INDEX IDX_TASK_SIGN_LINE_TASK_ID ON BPM_TASK_SIGN_LINE (TASK_ID_);
CREATE INDEX IDX_TASK_SIGN_LINE_INSTANCE_ID ON BPM_TASK_SIGN_LINE (INSTANCE_ID_);
CREATE INDEX IDX_TASK_REMINDER_TASK_ID ON BPM_TASK_REMINDER (TASK_ID_);
CREATE INDEX IDX_TASK_NDP_DEF_ID ON BPM_TASK_NOTICE_DONE (PROC_DEF_ID_);
CREATE INDEX IDX_TASK_NOTICE_OWNER_ID ON BPM_TASK_NOTICE (OWNER_ID_);

-- 用户中心
CREATE INDEX IDX_USER_UNITE_USERID ON UC_USER_UNITE (USER_ID_);
CREATE INDEX IDX_USER_UNDER_USERID ON UC_USER_UNDER (USER_ID_);
CREATE INDEX IDX_USER_REL_PARENTID ON UC_USER_REL (PARENT_ID_);
CREATE INDEX IDX_USER_PARAMS_USERID ON UC_USER_PARAMS (USER_ID_);
CREATE INDEX IDX_USER_PARAMS_CODE ON UC_USER_PARAMS (CODE_);   
-- DROP INDEX IDX_GROUP_CODE_UNQ;
-- DROP INDEX IDX_GROUP_CODE_UNQ ON UC_USER_GROUP;
-- CREATE UNIQUE INDEX IDX_GROUP_CODE_UNQ ON UC_USER_GROUP (CODE_,TENANT_ID_);
CREATE INDEX IDX_TENANT_TYPE_CODE ON UC_TENANT_TYPE (CODE_); 
CREATE INDEX IDX_TENANT_PARAMS_TENANTID ON UC_TENANT_PARAMS (TENANT_ID_);
CREATE INDEX IDX_TENANT_PARAMS_CODE ON UC_TENANT_PARAMS (CODE_);
CREATE INDEX IDX_TENANT_MANAGE_TYPEID ON UC_TENANT_MANAGE (TYPE_ID_);
CREATE INDEX IDX_TENANT_MAIL_TENANTID ON UC_TENANT_MAIL_SERVER (TENANT_ID_);
CREATE INDEX IDX_TENANT_LOGS_TENANTID ON UC_TENANT_LOGS (TENANT_ID_);
CREATE INDEX IDX_TENANT_IGNOREMENU_TENANTID ON UC_TENANT_IGNORE_MENU (TENANT_ID_);
CREATE INDEX IDX_TENANT_AUTH_USERID ON UC_TENANT_AUTH (USER_ID_);   
CREATE INDEX IDX_SHIFT_USER_SHIFTID ON UC_SHIFT_USER (SHIFT_ID_);
CREATE INDEX IDX_SHIFT_USER_USERID ON UC_SHIFT_USER (USER_ID_);
CREATE INDEX IDX_SHIFT_RULE_ISDELE ON UC_SHIFT_RULE (IS_DELE_);
CREATE INDEX IDX_REL_TYPE_CODE ON UC_REL_TYPE (CODE_); 
CREATE INDEX IDX_REL_AUTH_USERID ON UC_REL_AUTH (USER_ID_);
CREATE INDEX IDX_REL_AUTH_RELID ON UC_REL_AUTH (REL_ID_);
CREATE INDEX IDX_PWD_STRATEGY_TENANTID ON UC_PWD_STRATEGY (TENANT_ID_); 
CREATE INDEX IDX_ORG_USER_USERID ON UC_ORG_USER (USER_ID_);
CREATE INDEX IDX_ORG_USER_ORGID ON UC_ORG_USER (ORG_ID_);
CREATE INDEX IDX_ORG_ROLE_ROLEID ON UC_ORG_ROLE (ROLE_ID_);
CREATE INDEX IDX_ORG_ROLE_ORGID ON UC_ORG_ROLE (ORG_ID_);
CREATE INDEX IDX_ORG_POST_JOBID ON UC_ORG_POST (JOB_ID_);
CREATE INDEX IDX_PRG_POST_ORGID ON UC_ORG_POST (ORG_ID_);
CREATE INDEX IDX_ORG_PARAMS_ORGID ON UC_ORG_PARAMS (ORG_ID_);  
CREATE INDEX IDX_ORG_AUTH_ORGID ON UC_ORG_AUTH (ORG_ID_);
CREATE INDEX IDX_ORG_AUTH_USERID ON UC_ORG_AUTH (USER_ID_);
CREATE INDEX IDX_ORG_AUTH_DEMID ON UC_ORG_AUTH (DEM_ID_);
CREATE INDEX IDX_OPERATE_LOG_TENANTID ON UC_OPERATE_LOG (TENANT_ID_);
CREATE INDEX IDX_OPERATE_LOG_CREATETIME ON UC_OPERATE_LOG (CREATE_TIME_);
CREATE INDEX IDX_MATRIX_COL_DEF_MATRIXID ON UC_MATRIX_COL_DEF (MATRIX_ID_);
CREATE INDEX IDX_MATRIX_COL_DEF_COLTYPE ON UC_MATRIX_COL_DEF (COL_TYPE_);
CREATE INDEX IDX_UC_MATRIX_CODE ON UC_MATRIX (CODE_);
CREATE INDEX IDX_LOGIN_LOG_ACCOUNT ON UC_LOGIN_LOG (ACCOUNT_);
CREATE INDEX IDX_ELECTRONIC_SEAL_USERID ON UC_ELECTRONIC_SEAL (USER_ID_);
