feat(config): add live slow-sql threshold setting

This commit is contained in:
2026-02-07 14:31:24 +08:00
parent 6a9858cdec
commit b84a5abb8a
28 changed files with 197 additions and 63 deletions

View File

@@ -74,6 +74,7 @@ def _get_migration_steps():
(17, _migrate_to_v17),
(18, _migrate_to_v18),
(19, _migrate_to_v19),
(20, _migrate_to_v20),
]
@@ -884,3 +885,21 @@ def _migrate_to_v19(conn):
cursor.execute(statement)
conn.commit()
def _migrate_to_v20(conn):
"""迁移到版本20 - 慢SQL阈值系统配置"""
cursor = conn.cursor()
columns = _get_table_columns(cursor, "system_config")
_add_column_if_missing(
cursor,
"system_config",
columns,
"db_slow_query_ms",
"INTEGER DEFAULT 120",
ok_message=" [OK] 添加 system_config.db_slow_query_ms 字段",
)
conn.commit()