auto_trade_sys/backend/database/add_client_order_id.sql

6 lines
492 B
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.

-- 为 trades 表增加「自定义订单号」字段,用于存储币安 clientOrderId便于在订单记录中核对系统单
-- 若已存在该列可跳过本句
ALTER TABLE trades ADD COLUMN client_order_id VARCHAR(64) NULL COMMENT '币安自定义订单号 clientOrderId系统单格式: 前缀_时间戳_随机' AFTER entry_order_id;
-- 可选:为按自定义订单号查询建索引(若已存在可跳过)
-- CREATE INDEX idx_client_order_id ON trades (client_order_id);