create table sj_retry_task
(
    id               bigint unsigned auto_increment comment '主键'
        primary key,
    namespace_id     varchar(64) default '764d604ec6fc45f68cd92514c40e9e1a' not null comment '命名空间id',
    group_name       varchar(64)                                            not null comment '组名称',
    scene_name       varchar(64)                                            not null comment '场景名称',
    retry_id         bigint                                                 not null comment '重试信息Id',
    ext_attrs        text                                                   not null comment '扩展字段',
    task_status      tinyint     default 1                                  not null comment '重试状态',
    task_type        tinyint     default 1                                  not null comment '任务类型 1、重试数据 2、回调数据',
    operation_reason tinyint     default 0                                  not null comment '操作原因',
    client_info      varchar(128)                                           null comment '客户端地址 clientId#ip:port',
    create_dt        datetime    default CURRENT_TIMESTAMP                  not null comment '创建时间',
    update_dt        datetime    default CURRENT_TIMESTAMP                  not null on update CURRENT_TIMESTAMP comment '修改时间'
)
    comment '重试任务表';

create index idx_create_dt
    on sj_retry_task (create_dt);

create index idx_group_name_scene_name
    on sj_retry_task (namespace_id, group_name, scene_name);

create index idx_retry_id
    on sj_retry_task (retry_id);

create index task_status
    on sj_retry_task (task_status);

