fix: 完善日计划租约精度与安全配置
This commit is contained in:
@@ -70,7 +70,7 @@ CREATE TABLE IF NOT EXISTS `lms_daily_plan_claim` (
|
||||
`version` int NOT NULL DEFAULT 0 COMMENT '领取乐观锁版本号',
|
||||
`claim_status` tinyint NOT NULL DEFAULT 0 COMMENT '领取状态:0执行中,1已确认,2已释放,3已过期',
|
||||
`active_flag` tinyint DEFAULT 1 COMMENT '有效领取唯一标记,终态置空',
|
||||
`expire_time` datetime NOT NULL COMMENT '租约过期时间',
|
||||
`expire_time` datetime(6) NOT NULL COMMENT '租约过期时间',
|
||||
`confirmed_time` datetime DEFAULT NULL COMMENT '确认时间',
|
||||
`operator` varchar(64) NOT NULL COMMENT '领取人/执行器',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
@@ -98,7 +98,8 @@ CREATE TABLE IF NOT EXISTS `lms_daily_plan_operation_log` (
|
||||
`operation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`operation_log_id`)
|
||||
PRIMARY KEY (`operation_log_id`),
|
||||
KEY `idx_plan_operation_time` (`tenant_id`, `daily_plan_id`, `deleted`, `operation_time`)
|
||||
) COMMENT='LMS日计划操作日志';
|
||||
|
||||
-- 兼容已执行过旧版脚本的数据库,幂等补充候选组合索引。
|
||||
@@ -113,6 +114,23 @@ SET @lms_daily_plan_ddl = IF(
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan_claim' AND column_name = 'expire_time'
|
||||
AND datetime_precision = 6),
|
||||
'SELECT 1',
|
||||
'ALTER TABLE lms_daily_plan_claim MODIFY COLUMN expire_time DATETIME(6) NOT NULL COMMENT ''租约过期时间''');
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.statistics WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan_operation_log' AND index_name = 'idx_plan_operation_time'),
|
||||
'SELECT 1',
|
||||
'ALTER TABLE lms_daily_plan_operation_log ADD INDEX idx_plan_operation_time (tenant_id, daily_plan_id, deleted, operation_time)');
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan_claim' AND column_name = 'progress_qty'),
|
||||
|
||||
Reference in New Issue
Block a user