gtsoft-snail-job-server/doc/sql/easy_retry_mysql.sql
byteblogs168 02b900125f fix: 2.5.0
1. 修复看板重试场景列表统计错误
2. 修复通知和场景列表页查询问题
3. 删除retry_summary的多余索引问题
2023-12-11 22:20:32 +08:00

442 lines
27 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DROP
DATABASE IF EXISTS easy_retry;
CREATE
DATABASE easy_retry;
USE
easy_retry;
CREATE TABLE `namespace`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(64) NOT NULL COMMENT '名称',
`unique_id` varchar(64) NOT NULL COMMENT '唯一id',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
PRIMARY KEY (`id`),
KEY `idx_name` (`name`),
UNIQUE KEY `uk_unique_id` (`unique_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间';
INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`)
VALUES (1, 'Default', '764d604ec6fc45f68cd92514c40e9e1a', now(), now(), 0);
CREATE TABLE `group_config`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组名称',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '组描述',
`group_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '组状态 0、未启用 1、启用',
`version` int(11) NOT NULL COMMENT '版本号',
`group_partition` int(11) NOT NULL COMMENT '分区',
`id_generator_mode` tinyint(4) NOT NULL DEFAULT '1' COMMENT '唯一id生成模式 默认号段模式',
`init_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否初始化场景 0:否 1:是',
`bucket_index` int(11) NOT NULL DEFAULT '0' COMMENT 'bucket',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id_group_name` (`namespace_id`, `group_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='组配置'
;
CREATE TABLE `notify_config`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
`notify_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知状态 0、未启用 1、启用',
`notify_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知类型 1、钉钉 2、邮件 3、企业微信',
`notify_attribute` varchar(512) NOT NULL COMMENT '配置属性',
`notify_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '通知阈值',
`notify_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知场景',
`rate_limiter_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '限流状态 0、未启用 1、启用',
`rate_limiter_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '每秒限流阈值',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='通知配置'
;
CREATE TABLE `retry_dead_letter_0`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
`args_str` text NOT NULL COMMENT '执行方法参数',
`ext_attrs` text NOT NULL COMMENT '扩展字段',
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
KEY `idx_idempotent_id` (`idempotent_id`),
KEY `idx_biz_no` (`biz_no`),
KEY `idx_create_dt` (`create_dt`),
UNIQUE KEY `uk_namespace_id_group_name_unique_id` (`namespace_id`, `group_name`, `unique_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='死信队列表'
;
CREATE TABLE `retry_task_0`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
`args_str` text NOT NULL COMMENT '执行方法参数',
`ext_attrs` text NOT NULL COMMENT '扩展字段',
`next_trigger_at` datetime NOT NULL COMMENT '下次触发时间',
`retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '重试次数',
`retry_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '重试状态 0、重试中 1、成功 2、最大重试次数',
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`,`group_name`, `scene_name`),
KEY `idx_namespace_id_group_name_task_type` (`namespace_id`,`group_name`, `task_type`),
KEY `idx_namespace_id_group_name_retry_status` (`namespace_id`,`group_name`, `retry_status`),
KEY `idx_idempotent_id` (`idempotent_id`),
KEY `idx_biz_no` (`biz_no`),
KEY `idx_create_dt` (`create_dt`),
UNIQUE KEY `uk_name_unique_id` (`namespace_id`, `group_name`, `unique_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='任务表'
;
CREATE TABLE `retry_task_log`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
`args_str` text NOT NULL COMMENT '执行方法参数',
`ext_attrs` text NOT NULL COMMENT '扩展字段',
`retry_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '重试状态 0、重试中 1、成功 2、最大次数',
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_group_name_scene_name` (`namespace_id`,`group_name`, `scene_name`),
KEY `idx_retry_status` (`retry_status`),
KEY `idx_idempotent_id` (`idempotent_id`),
KEY `idx_unique_id` (`unique_id`),
KEY `idx_biz_no` (`biz_no`),
KEY `idx_create_dt` (`create_dt`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='任务日志基础信息表'
;
CREATE TABLE `retry_task_log_message`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`message` text NOT NULL COMMENT '异常信息',
`client_info` varchar(128) DEFAULT NULL COMMENT '客户端地址 clientId#ip:port',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`,`group_name`, `unique_id`),
KEY `idx_create_dt` (`create_dt`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='任务调度日志信息记录表'
;
CREATE TABLE `scene_config`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`scene_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '组状态 0、未启用 1、启用',
`max_retry_count` int(11) NOT NULL DEFAULT '5' COMMENT '最大重试次数',
`back_off` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1、默认等级 2、固定间隔时间 3、CRON 表达式',
`trigger_interval` varchar(16) NOT NULL DEFAULT '' COMMENT '间隔时长',
`deadline_request` bigint(20) unsigned NOT NULL DEFAULT '60000' COMMENT 'Deadline Request 调用链超时 单位毫秒',
`executor_timeout` int(11) unsigned NOT NULL DEFAULT '5' COMMENT '任务执行超时时间,单位秒',
`route_key` tinyint(4) NOT NULL DEFAULT '4' COMMENT '路由策略',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='场景配置'
;
CREATE TABLE `server_node`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`host_id` varchar(64) NOT NULL COMMENT '主机id',
`host_ip` varchar(64) NOT NULL COMMENT '机器ip',
`context_path` varchar(256) NOT NULL DEFAULT '/' COMMENT '客户端上下文路径 server.servlet.context-path',
`host_port` int(16) NOT NULL COMMENT '机器端口',
`expire_at` datetime NOT NULL COMMENT '过期时间',
`node_type` tinyint(4) NOT NULL COMMENT '节点类型 1、客户端 2、是服务端',
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name` (`namespace_id`,`group_name`),
KEY `idx_expire_at_node_type` (`expire_at`, `node_type`),
UNIQUE KEY `uk_host_id_host_ip` (`host_id`, `host_ip`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='服务器节点'
;
CREATE TABLE `distributed_lock`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(64) NOT NULL COMMENT '锁名称',
`lock_until` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '锁定时长',
`locked_at` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '锁定时间',
`locked_by` varchar(255) NOT NULL COMMENT '锁定者',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_name` (`name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='锁定表'
;
CREATE TABLE `system_user`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(64) NOT NULL COMMENT '账号',
`password` varchar(128) NOT NULL COMMENT '密码',
`role` tinyint(4) NOT NULL DEFAULT '0' COMMENT '角色1-普通用户、2-管理员',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_username` (`username`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户表';
-- pwd: admin
INSERT INTO system_user (username, password, role)
VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2);
CREATE TABLE `system_user_permission`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`system_user_id` bigint(20) NOT NULL COMMENT '系统用户id',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id_group_name_system_user_id` (`namespace_id`, `group_name`, `system_user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户权限表';
CREATE TABLE `sequence_alloc`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组名称',
`max_id` bigint(20) NOT NULL DEFAULT '1' COMMENT '最大id',
`step` int(11) NOT NULL DEFAULT '100' COMMENT '步长',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id_group_name` (`namespace_id`, `group_name`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='号段模式序号ID分配表';
-- 分布式调度DDL
CREATE TABLE `job`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
`group_name` varchar(64) NOT NULL COMMENT '组名称',
`job_name` varchar(64) NOT NULL COMMENT '名称',
`args_str` text DEFAULT NULL COMMENT '执行方法参数',
`args_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '参数类型 ',
`next_trigger_at` bigint(13) NOT NULL COMMENT '下次触发时间',
`job_status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '重试状态 0、关闭、1、开启',
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、集群 2、广播 3、切片',
`route_key` tinyint(4) NOT NULL DEFAULT '4' COMMENT '路由策略',
`executor_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '执行器类型',
`executor_info` varchar(255) DEFAULT NULL COMMENT '执行器名称',
`trigger_type` tinyint(4) NOT NULL COMMENT '触发类型 1.CRON 表达式 2. 固定时间',
`trigger_interval` varchar(255) NOT NULL COMMENT '',
`block_strategy` tinyint(4) NOT NULL DEFAULT '1' COMMENT ' 1 2 3',
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '',
`max_retry_times` int(11) NOT NULL DEFAULT '0' COMMENT '',
`parallel_num` int(11) NOT NULL DEFAULT '1' COMMENT '',
`retry_interval` int(11) NOT NULL DEFAULT '0' COMMENT '(s)',
`bucket_index` int(11) NOT NULL DEFAULT '0' COMMENT 'bucket',
`resident` tinyint(4) NOT NULL DEFAULT '0' COMMENT '',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '',
`ext_attrs` varchar(256) NULL default '' COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 1',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
KEY `idx_job_status_bucket_index` (`job_status`, `bucket_index`),
KEY `idx_create_dt` (`create_dt`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='';
CREATE TABLE `job_log_message`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` varchar(64) NOT NULL COMMENT '',
`job_id` bigint(20) NOT NULL COMMENT 'id',
`task_batch_id` bigint(20) NOT NULL COMMENT 'id',
`task_id` bigint(20) NOT NULL COMMENT 'id',
`message` text NOT NULL COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`ext_attrs` varchar(256) NULL default '' COMMENT '',
PRIMARY KEY (`id`),
KEY `idx_task_batch_id_task_id` (`task_batch_id`, `task_id`),
KEY `idx_create_dt` (`create_dt`),
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='';
CREATE TABLE `job_task`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` varchar(64) NOT NULL COMMENT '',
`job_id` bigint(20) NOT NULL COMMENT 'id',
`task_batch_id` bigint(20) NOT NULL COMMENT 'id',
`parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'id',
`task_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0 1',
`retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '',
`client_info` varchar(128) DEFAULT NULL COMMENT ' clientId#ip:port',
`result_message` text NOT NULL COMMENT '',
`args_str` text DEFAULT NULL COMMENT '',
`args_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT ' ',
`ext_attrs` varchar(256) NULL default '' COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`),
KEY `idx_task_batch_id_task_status` (`task_batch_id`, `task_status`),
KEY `idx_create_dt` (`create_dt`),
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='';
CREATE TABLE `job_task_batch`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` varchar(64) NOT NULL COMMENT '',
`job_id` bigint(20) NOT NULL COMMENT 'id',
`task_batch_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0 1',
`operation_reason` tinyint(4) NOT NULL DEFAULT '0' COMMENT '',
`execution_at` bigint(13) NOT NULL DEFAULT '0' COMMENT '',
`parent_id` varchar(64) NOT NULL DEFAULT '' COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 1',
`ext_attrs` varchar(256) NULL default '' COMMENT '',
PRIMARY KEY (`id`),
KEY `idx_job_id_task_batch_status` (`job_id`, `task_batch_status`),
KEY `idx_create_dt` (`create_dt`),
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
) ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARSET = utf8mb4 COMMENT ='';
CREATE TABLE `job_notify_config`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` varchar(64) NOT NULL COMMENT '',
`job_id` bigint(20) NOT NULL COMMENT 'id',
`notify_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0 1',
`notify_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 1 2 3',
`notify_attribute` varchar(512) NOT NULL COMMENT '',
`notify_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '',
`notify_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '',
`rate_limiter_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0 1',
`rate_limiter_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '',
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_job_id` (`namespace_id`,`group_name`, job_id)
) ENGINE=InnoDB
AUTO_INCREMENT=4
DEFAULT CHARSET=utf8mb4 COMMENT='job通知配置';
CREATE TABLE `job_summary`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '',
`job_id` bigint NOT NULL COMMENT 'id',
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`success_num` int NOT NULL DEFAULT '0' COMMENT '-',
`fail_num` int NOT NULL DEFAULT '0' COMMENT '-',
`fail_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '',
`stop_num` int NOT NULL DEFAULT '0' COMMENT '-',
`stop_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '',
`cancel_num` int NOT NULL DEFAULT '0' COMMENT '-',
`cancel_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`),
KEY `idx_namespace_id_group_name_job_id` (`namespace_id`, `group_name`, job_id),
UNIQUE KEY `uk_job_id_trigger_at` (`job_id`, `trigger_at`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Job';
CREATE TABLE `retry_summary`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT 'id',
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '',
`scene_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '',
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`running_num` int NOT NULL DEFAULT '0' COMMENT '-',
`finish_num` int NOT NULL DEFAULT '0' COMMENT '-',
`max_count_num` int NOT NULL DEFAULT '0' COMMENT '-',
`suspend_num` int NOT NULL DEFAULT '0' COMMENT '-',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_scene_name_trigger_at` (`namespace_id`, `group_name`, `scene_name`, `trigger_at`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Retry';