提交更新

This commit is contained in:
super
2026-05-02 09:28:26 +08:00
parent aece8123c3
commit 3ce66a59ee
13 changed files with 380 additions and 33 deletions

View File

@@ -0,0 +1,35 @@
SET @schema_name = DATABASE();
SET @idx_file_result_patrol_history_exists := (
SELECT COUNT(1)
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = @schema_name
AND TABLE_NAME = 'biz_file_result'
AND INDEX_NAME = 'idx_file_result_patrol_history'
);
SET @sql_add_file_result_patrol_history_idx := IF(
@idx_file_result_patrol_history_exists = 0,
'ALTER TABLE biz_file_result ADD INDEX idx_file_result_patrol_history (module_type, user_id, created_at, id)',
'SELECT 1'
);
PREPARE stmt_add_file_result_patrol_history_idx FROM @sql_add_file_result_patrol_history_idx;
EXECUTE stmt_add_file_result_patrol_history_idx;
DEALLOCATE PREPARE stmt_add_file_result_patrol_history_idx;
SET @idx_file_task_patrol_history_exists := (
SELECT COUNT(1)
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA = @schema_name
AND TABLE_NAME = 'biz_file_task'
AND INDEX_NAME = 'idx_file_task_patrol_history'
);
SET @sql_add_file_task_patrol_history_idx := IF(
@idx_file_task_patrol_history_exists = 0,
'ALTER TABLE biz_file_task ADD INDEX idx_file_task_patrol_history (module_type, id, status, finished_at)',
'SELECT 1'
);
PREPARE stmt_add_file_task_patrol_history_idx FROM @sql_add_file_task_patrol_history_idx;
EXECUTE stmt_add_file_task_patrol_history_idx;
DEALLOCATE PREPARE stmt_add_file_task_patrol_history_idx;