update
This commit is contained in:
parent
9676e9a13e
commit
82d8f1a849
@ -65,7 +65,7 @@ class PaperOrder(Base):
|
|||||||
signal_type = Column(String(20), default="swing") # swing / short_term
|
signal_type = Column(String(20), default="swing") # swing / short_term
|
||||||
confidence = Column(Float, default=0) # 置信度 (0-100)
|
confidence = Column(Float, default=0) # 置信度 (0-100)
|
||||||
trend = Column(String(20), nullable=True) # 趋势方向
|
trend = Column(String(20), nullable=True) # 趋势方向
|
||||||
entry_type = Column(SQLEnum(EntryType), default=EntryType.MARKET) # 入场类型
|
entry_type = Column(SQLEnum(EntryType, values_callable=lambda x: [e.value for e in x]), default=EntryType.MARKET) # 入场类型
|
||||||
|
|
||||||
# 订单状态
|
# 订单状态
|
||||||
status = Column(SQLEnum(OrderStatus), default=OrderStatus.PENDING, index=True)
|
status = Column(SQLEnum(OrderStatus), default=OrderStatus.PENDING, index=True)
|
||||||
|
|||||||
@ -30,7 +30,11 @@ if [ -f "$DB_PATH" ]; then
|
|||||||
sqlite3 "$DB_PATH" "ALTER TABLE paper_orders ADD COLUMN entry_type VARCHAR(10) DEFAULT 'market';"
|
sqlite3 "$DB_PATH" "ALTER TABLE paper_orders ADD COLUMN entry_type VARCHAR(10) DEFAULT 'market';"
|
||||||
echo " entry_type 列已添加"
|
echo " entry_type 列已添加"
|
||||||
else
|
else
|
||||||
echo " entry_type 列已存在,跳过"
|
echo " entry_type 列已存在"
|
||||||
|
# 修复可能存在的大写值问题
|
||||||
|
sqlite3 "$DB_PATH" "UPDATE paper_orders SET entry_type = 'market' WHERE entry_type = 'MARKET';"
|
||||||
|
sqlite3 "$DB_PATH" "UPDATE paper_orders SET entry_type = 'limit' WHERE entry_type = 'LIMIT';"
|
||||||
|
echo " entry_type 值已标准化"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo " 数据库文件不存在,将在首次运行时创建"
|
echo " 数据库文件不存在,将在首次运行时创建"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user