当前位置:   article > 正文

Activity 5.17 mysql 建表sql_`act_ru_task`, constraint `act_fk_task_exe` foreig

`act_ru_task`, constraint `act_fk_task_exe` foreign key (`execution_id_`) re

因为部分表存在外键。按以下顺序可顺利建表。否则有些表会因外键建表失败。

01

-- 导出  表 act_re_deployment 结构  
DROP TABLE IF EXISTS `act_re_deployment`;  
CREATE TABLE IF NOT EXISTS `act_re_deployment` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL default '',  
  `NAME_` varchar(255) collate utf8_bin default NULL,  
  `CATEGORY_` varchar(255) collate utf8_bin default NULL,  
  `DEPLOY_TIME_` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  
  PRIMARY KEY  (`ID_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;  






02
-- 导出  表 act_ge_bytearray 结构  
DROP TABLE IF EXISTS `act_ge_bytearray`;  
CREATE TABLE IF NOT EXISTS `act_ge_bytearray` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL default '',  
  `REV_` int(11) default NULL,  
  `NAME_` varchar(255) collate utf8_bin default NULL,  
  `DEPLOYMENT_ID_` varchar(64) collate utf8_bin default NULL,  
  `BYTES_` longblob,  
  `GENERATED_` tinyint(4) default NULL,  
  PRIMARY KEY  (`ID_`),  
  KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`),  
  CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `act_re_deployment` (`ID_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;  




03
-- 导出  表 act_ge_property 结构  
DROP TABLE IF EXISTS `act_ge_property`;  
CREATE TABLE IF NOT EXISTS `act_ge_property` (  
  `NAME_` varchar(64) collate utf8_bin NOT NULL default '',  
  `VALUE_` varchar(300) collate utf8_bin default NULL,  
  `REV_` int(11) default NULL,  
  PRIMARY KEY  (`NAME_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 




04
-- 导出  表 act_hi_actinst 结构  
DROP TABLE IF EXISTS `act_hi_actinst`;  
CREATE TABLE IF NOT EXISTS `act_hi_actinst` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL,  
  `PROC_DEF_ID_` varchar(64) collate utf8_bin NOT NULL,  
  `PROC_INST_ID_` varchar(64) collate utf8_bin NOT NULL,  
  `EXECUTION_ID_` varchar(64) collate utf8_bin NOT NULL,  
  `ACT_ID_` varchar(255) collate utf8_bin NOT NULL,  
  `TASK_ID_` varchar(64) collate utf8_bin default NULL,  
  `CALL_PROC_INST_ID_` varchar(64) collate utf8_bin default NULL,  
  `ACT_NAME_` varchar(255) collate utf8_bin default NULL,  
  `ACT_TYPE_` varchar(255) collate utf8_bin NOT NULL,  
  `ASSIGNEE_` varchar(255) collate utf8_bin default NULL,  
  `START_TIME_` datetime NOT NULL,  
  `END_TIME_` datetime default NULL,  
  `DURATION_` bigint(20) default NULL,  
  PRIMARY KEY  (`ID_`),  
  KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`),  
  KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`),  
  KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`),  
  KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;  




05
-- 导出  表 act_hi_attachment 结构  
DROP TABLE IF EXISTS `act_hi_attachment`;  
CREATE TABLE IF NOT EXISTS `act_hi_attachment` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL,  
  `REV_` int(11) default NULL,  
  `USER_ID_` varchar(255) collate utf8_bin default NULL,  
  `NAME_` varchar(255) collate utf8_bin default NULL,  
  `DESCRIPTION_` varchar(4000) collate utf8_bin default NULL,  
  `TYPE_` varchar(255) collate utf8_bin default NULL,  
  `TASK_ID_` varchar(64) collate utf8_bin default NULL,  
  `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL,  
  `URL_` varchar(4000) collate utf8_bin default NULL,  
  `CONTENT_ID_` varchar(64) collate utf8_bin default NULL,  
  PRIMARY KEY  (`ID_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;  


06
-- 导出  表 act_hi_comment 结构  
DROP TABLE IF EXISTS `act_hi_comment`;  
CREATE TABLE IF NOT EXISTS `act_hi_comment` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL,  
  `TYPE_` varchar(255) collate utf8_bin default NULL,  
  `TIME_` datetime NOT NULL,  
  `USER_ID_` varchar(255) collate utf8_bin default NULL,  
  `TASK_ID_` varchar(64) collate utf8_bin default NULL,  
  `PROC_INST_ID_` varchar(64) collate utf8_bin default NULL,  
  `ACTION_` varchar(255) collate utf8_bin default NULL,  
  `MESSAGE_` varchar(4000) collate utf8_bin default NULL,  
  `FULL_MSG_` longblob,  
  PRIMARY KEY  (`ID_`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;  


07
-- 导出  表 act_hi_detail 结构  
DROP TABLE IF EXISTS `act_hi_detail`;  
CREATE TABLE IF NOT EXISTS `act_hi_detail` (  
  `ID_` varchar(64) collate utf8_bin NOT NULL,  
  `TYPE_` varchar(255) collate utf8_bin
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/164216
推荐阅读
相关标签
  

闽ICP备14008679号