feat: add kill-switch control flow
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- BAT-012 / REQ-044: day-scoped kill-switch exclusion overlay.
|
||||
-- Distinct from snapshot_pause (permanent, resume-until). A row excludes a
|
||||
-- portfolio (or '*' for global) from strategy execution for ONE trading_date;
|
||||
-- the next trading day is automatically clear because reads filter by
|
||||
-- trading_date. Manual resume (REQ-046) deletes the row.
|
||||
CREATE TABLE IF NOT EXISTS killswitch_exclusion (
|
||||
portfolio_id TEXT NOT NULL, -- '*' = global exclusion sentinel
|
||||
trading_date DATE NOT NULL,
|
||||
actor TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT (now() AT TIME ZONE 'UTC'),
|
||||
PRIMARY KEY (portfolio_id, trading_date)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_killswitch_exclusion_trading_date
|
||||
ON killswitch_exclusion (trading_date);
|
||||
Reference in New Issue
Block a user