SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for jobcluster
-- ----------------------------
DROP TABLE IF EXISTS `jobcluster`;
CREATE TABLE `jobcluster`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `ClusterId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '作业集群Id',
  `Description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述信息',
  `Status` int(11) NOT NULL COMMENT '状态',
  `UpdatedTime` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统作业集群表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for jobdetails
-- ----------------------------
DROP TABLE IF EXISTS `jobdetails`;
CREATE TABLE `jobdetails`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `JobId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '作业Id',
  `GroupName` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组名称',
  `JobType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作业类型',
  `AssemblyName` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '程序集',
  `Description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述信息',
  `Concurrent` tinyint(1) NOT NULL COMMENT '是否并行执行',
  `IncludeAnnotations` tinyint(1) NOT NULL COMMENT '是否扫描特性触发器',
  `Properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '额外数据',
  `UpdatedTime` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `CreateType` int(11) NOT NULL COMMENT '作业创建类型',
  `ScriptCode` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '脚本代码',
  `TenantId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID',
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '作业信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for jobtriggers
-- ----------------------------
DROP TABLE IF EXISTS `jobtriggers`;
CREATE TABLE `jobtriggers`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `TriggerId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '触发器Id',
  `JobId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '作业Id',
  `TriggerType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '触发器类型',
  `AssemblyName` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '程序集',
  `Args` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数',
  `Description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述信息',
  `Status` int(11) NOT NULL COMMENT '状态',
  `StartTime` datetime NULL DEFAULT NULL COMMENT '起始时间',
  `EndTime` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `LastRunTime` datetime NULL DEFAULT NULL COMMENT '最近运行时间',
  `NextRunTime` datetime NULL DEFAULT NULL COMMENT '下一次运行时间',
  `NumberOfRuns` bigint(20) NOT NULL COMMENT '触发次数',
  `MaxNumberOfRuns` bigint(20) NOT NULL COMMENT '最大触发次数',
  `NumberOfErrors` bigint(20) NOT NULL COMMENT '出错次数',
  `MaxNumberOfErrors` bigint(20) NOT NULL COMMENT '最大出错次数',
  `NumRetries` int(11) NOT NULL COMMENT '重试次数',
  `RetryTimeout` int(11) NOT NULL COMMENT '重试间隔时间(ms)',
  `StartNow` tinyint(1) NOT NULL COMMENT '是否立即启动',
  `RunOnStart` tinyint(1) NOT NULL COMMENT '是否启动时执行一次',
  `ResetOnlyOnce` tinyint(1) NOT NULL COMMENT '是否在启动时重置最大触发次数等于一次的作业',
  `UpdatedTime` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '作业触发器表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
