/*

 Target Server Type    : MySQL
 Target Server Version : 50730
 File Encoding         : 65001

 Date: 22/03/2023 16:49:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for wk_hi_operation
-- ----------------------------
DROP TABLE IF EXISTS `wk_hi_operation`;
CREATE TABLE `wk_hi_operation`  (
  `task_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务id',
  `node_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '节点id',
  `process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '流程实例id',
  `operation_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作名称',
  `operation` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '行为',
  `approval_mode` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审批模式',
  `message` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '评论json数据',
  `node_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点类型',
  `state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '返回类型',
  `user_info` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '用户json数据',
  `finish_time` datetime NULL DEFAULT NULL COMMENT '完成时间',
  `start_time` bigint(22) UNSIGNED NULL DEFAULT NULL COMMENT '开始时间',
  `mark` int(1) NULL DEFAULT 0 COMMENT '是否被回退标记, 1 回退 0 正常',
  PRIMARY KEY (`task_id`) USING BTREE,
  INDEX `start_time_index`(`start_time`) USING BTREE COMMENT '开始时间索引'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_process_file
-- ----------------------------
DROP TABLE IF EXISTS `wk_process_file`;
CREATE TABLE `wk_process_file`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `file_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
  `original_filename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '原始文件名称',
  `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '访问路径',
  `uri` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源定位',
  `file_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件类型',
  `size` int(11) NULL DEFAULT NULL COMMENT '文件大小',
  `is_images` int(1) NULL DEFAULT NULL COMMENT '是否是图片',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 26 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_re_form_perm
-- ----------------------------
DROP TABLE IF EXISTS `wk_re_form_perm`;
CREATE TABLE `wk_re_form_perm`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '表单id',
  `deployment_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实例id',
  `from_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'task的表单权限key',
  `required` int(1) NULL DEFAULT NULL COMMENT '是否必填',
  `perm` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限类型',
  PRIMARY KEY (`id`, `from_key`, `deployment_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_re_process_business
-- ----------------------------
DROP TABLE IF EXISTS `wk_re_process_business`;
CREATE TABLE `wk_re_process_business`  (
  `business_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '业务id',
  `group_id` int(11) NULL DEFAULT NULL COMMENT '分组id',
  `deployment_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程部署id',
  `process_definition_key` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署是的key',
  `deployment_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程部署名称',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`business_id`) USING BTREE,
  UNIQUE INDEX `deployment_id`(`deployment_id`) USING BTREE COMMENT '流程id索引'
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_re_process_data
-- ----------------------------
DROP TABLE IF EXISTS `wk_re_process_data`;
CREATE TABLE `wk_re_process_data`  (
  `deployment_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署id',
  `deployment_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部署名称',
  `logo` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'logo',
  `settings` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '设置信息',
  `process_str` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '流程字符串',
  `form_item_str` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '表单字符串',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_ru_form_item
-- ----------------------------
DROP TABLE IF EXISTS `wk_ru_form_item`;
CREATE TABLE `wk_ru_form_item`  (
  `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '表单id',
  `parent_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父id',
  `process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实例id',
  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '后端枚举变量',
  `value` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '值',
  `valueType` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值的类型',
  `props` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '配置信息',
  PRIMARY KEY (`id`, `process_instance_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for wk_ru_form_item_data
-- ----------------------------
DROP TABLE IF EXISTS `wk_ru_form_item_data`;
CREATE TABLE `wk_ru_form_item_data`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '表单id',
  `process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实例id',
  `form_data` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '表单数据',
  `is_start` int(1) NULL DEFAULT 0 COMMENT '是否为start的数据',
  `is_present` int(1) NULL DEFAULT NULL COMMENT '是否当前task需要的数据',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 191 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
