mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-23 23:51:18 +08:00
增强待办路由安全和查询索引
This commit is contained in:
20
docs/sql/sys_todo_performance_index.sql
Normal file
20
docs/sql/sys_todo_performance_index.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- 待办首页列表排序索引(用于已存在的 sys_todo_task 表)
|
||||
-- MySQL 5.7 兼容的幂等写法。
|
||||
|
||||
SET @todoIndexExists := (
|
||||
SELECT count(1)
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = database()
|
||||
AND table_name = 'sys_todo_task'
|
||||
AND index_name = 'idx_todo_user_active_sort'
|
||||
);
|
||||
|
||||
SET @todoIndexSql := IF(
|
||||
@todoIndexExists = 0,
|
||||
'ALTER TABLE sys_todo_task ADD INDEX idx_todo_user_active_sort (assignee_user_id, del_flag, task_status, priority, create_time, todo_id)',
|
||||
'SELECT ''idx_todo_user_active_sort already exists'''
|
||||
);
|
||||
|
||||
PREPARE todoIndexStatement FROM @todoIndexSql;
|
||||
EXECUTE todoIndexStatement;
|
||||
DEALLOCATE PREPARE todoIndexStatement;
|
||||
Reference in New Issue
Block a user