auto_trade_sys/backend/fix_config_category.sql
薇薇安 24b2746f12 a
2026-01-14 14:12:45 +08:00

27 lines
1.0 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 修复配置分类的SQL脚本
-- 确保 TOP_N_SYMBOLS 和 MAX_SCAN_SYMBOLS 都在 'scan' 分类下
USE auto_trade_sys;
-- 更新 TOP_N_SYMBOLS 分类为 scan如果当前不是
UPDATE trading_config
SET category = 'scan'
WHERE config_key = 'TOP_N_SYMBOLS' AND category != 'scan';
-- 更新 MAX_SCAN_SYMBOLS 分类为 scan如果当前不是
UPDATE trading_config
SET category = 'scan'
WHERE config_key = 'MAX_SCAN_SYMBOLS' AND category != 'scan';
-- 如果 MAX_SCAN_SYMBOLS 不存在,插入它
INSERT INTO trading_config (config_key, config_value, config_type, category, description)
VALUES ('MAX_SCAN_SYMBOLS', '500', 'number', 'scan', '扫描的最大交易对数量0表示扫描所有建议100-500')
ON DUPLICATE KEY UPDATE
category = 'scan',
description = '扫描的最大交易对数量0表示扫描所有建议100-500';
-- 验证结果
SELECT config_key, config_value, category, description
FROM trading_config
WHERE config_key IN ('TOP_N_SYMBOLS', 'MAX_SCAN_SYMBOLS');