双买交易行权价拆分为看涨行权价和看跌行权价,支持不同价位
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,15 @@ def _migrate(engine):
|
||||
if "point_value" not in cols:
|
||||
cur.execute("ALTER TABLE option_trades ADD COLUMN point_value INTEGER DEFAULT 20")
|
||||
|
||||
cur.execute("PRAGMA table_info(dual_option_trades)")
|
||||
cols = {row[1] for row in cur.fetchall()}
|
||||
if "call_strike_price" not in cols:
|
||||
cur.execute("ALTER TABLE dual_option_trades ADD COLUMN call_strike_price FLOAT DEFAULT 0")
|
||||
if "put_strike_price" not in cols:
|
||||
cur.execute("ALTER TABLE dual_option_trades ADD COLUMN put_strike_price FLOAT DEFAULT 0")
|
||||
if "strike_price" in cols:
|
||||
cur.execute("ALTER TABLE dual_option_trades DROP COLUMN strike_price")
|
||||
|
||||
conn.commit()
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user