alter table t_st_schedule_scheme
    add column `adjust_rate` int DEFAULT NULL COMMENT '调整速率';

alter table t_st_schedule_scheme
    add column `warning_adjust_rate` int DEFAULT NULL COMMENT '预警调整速率';

alter table t_mm_predict_alarm_config modify column `comp_length` varchar (30) COMMENT '比较长度';

CREATE TABLE `t_st_suggest_operation_record`
(
    `id`            varchar(36) NOT NULL,
    `title`         varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '标题',
    `content`       varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内容',
    `scheme_id`     varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '方案ID',
    `model_id`      varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '模型ID',
    `model_name`    varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '模型名称',
    `schedule_time` datetime                                                      DEFAULT NULL COMMENT '调度时间',
    `result_code`   varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '结果code',
    `result_data`   text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '调度结果',
    `operate`       varchar(36) NOT NULL COMMENT '操作（已采纳,取消采纳，已忽略等）',
    `handler_id`    varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '处理人ID',
    `handler`       varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '处理人',
    `handle_time`   datetime                                                      DEFAULT NULL COMMENT '处理时间',
    `create_time`   datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY             `idx_model_id` (`model_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='调度建议操作记录表';

CREATE TABLE `t_st_suggest_snapshot_conf_main`
(
    `id`           varchar(36) NOT NULL,
    `title`        varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '标题',
    `model_id`     varchar(36) COMMENT '模型ID',
    `schedule_obj` varchar(20) COMMENT '调整对象',
    `create_time`  datetime                                                     DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY            `idx_model_id` (`model_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='调度建议快照配置主表';

CREATE TABLE `t_st_suggest_snapshot_conf_det`
(
    `id`           varchar(36) NOT NULL,
    `conf_id`      varchar(36) COMMENT '快照配置ID',
    `data_type`    varchar(20) DEFAULT NULL COMMENT '数据类型（DATAPOINT,IND,PLAN,PREDICTITEM）',
    `data_no`      varchar(36) COMMENT '数据编号',
    `data_name`    varchar(36) COMMENT '数据名称',
    `left_length`  integer COMMENT '左侧长度(min)',
    `right_length` integer COMMENT '右侧侧长度(min)',
    `sort`         integer COMMENT '排序',
    `ext1`         varchar(50) COMMENT '拓展字段1',
    `ext2`         varchar(50) COMMENT '拓展字段1',
    `ext3`         varchar(50) COMMENT '拓展字段1',
    `ext4`         varchar(50) COMMENT '拓展字段1',
    `ext5`         varchar(50) COMMENT '拓展字段1',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `conf_id_data_name_unique` (`conf_id`,`data_name`),
    KEY            `idx_conf_id` (`conf_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='调度建议快照配置详情表';

CREATE TABLE `t_st_suggest_snapshot_record`
(
    `id`            varchar(36) NOT NULL,
    `suggest_id`    varchar(36) COMMENT '建议ID(只记录采纳)',
    `operation_id`  varchar(36) COMMENT '操作记录ID(只记录采纳)',
    `model_id`      varchar(36) DEFAULT NULL COMMENT '模型ID',
    `data_type`     varchar(20) DEFAULT NULL COMMENT '数据类型（DATAPOINT,IND,PLAN,PREDICTITEM）',
    `data_no`       varchar(36) COMMENT '数据编号',
    `data_name`     varchar(36) COMMENT '数据名称',
    `schedule_time` datetime    DEFAULT NULL COMMENT '调度时间',
    `start_time`    datetime    DEFAULT NULL COMMENT '开始时间',
    `end_time`      datetime    DEFAULT NULL COMMENT '结束时间',
    `json_value`    varchar(50) COMMENT '序列化的数据',
    `sort`          integer COMMENT '排序',
    PRIMARY KEY (`id`) USING BTREE,
    KEY             `idx_suggest_id` (`suggest_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='调度建议快照记录表';

ALTER TABLE `t_st_suggest_operation_record`
    ADD COLUMN `reason` varchar(255) NULL COMMENT '原因' AFTER `operate`;