Persist options review deletes across local resync.
Hide deleted rows by history key and contract/close fingerprint so local options_trades imports no longer resurrect them. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -109,6 +109,22 @@ def init_options_review_tables(conn: sqlite3.Connection) -> None:
|
||||
)
|
||||
"""
|
||||
)
|
||||
conn.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS options_review_hidden (
|
||||
history_key TEXT PRIMARY KEY,
|
||||
inst_id TEXT,
|
||||
closed_at TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
"""
|
||||
)
|
||||
conn.execute(
|
||||
"""
|
||||
CREATE INDEX IF NOT EXISTS idx_options_review_hidden_inst
|
||||
ON options_review_hidden(inst_id, closed_at)
|
||||
"""
|
||||
)
|
||||
_ensure_column(conn, "options_review_trades", "linked_hedge_plan_id", "INTEGER")
|
||||
_ensure_column(conn, "options_review_trades", "excluded_as_hedge_leg", "INTEGER DEFAULT 0")
|
||||
_ensure_column(conn, "options_review_trades", "target_price_up", "REAL")
|
||||
|
||||
Reference in New Issue
Block a user