-- Migration 011: Add active_confluence_threshold and regime to paper tables
-- Layer B6 / Layer A1 — enables structured exit diagnosis in paper path.

BEGIN;

ALTER TABLE paper_positions
    ADD COLUMN IF NOT EXISTS active_confluence_threshold SMALLINT,
    ADD COLUMN IF NOT EXISTS regime VARCHAR(16);

ALTER TABLE paper_trades
    ADD COLUMN IF NOT EXISTS active_confluence_threshold SMALLINT,
    ADD COLUMN IF NOT EXISTS regime VARCHAR(16);

INSERT INTO schema_versions (version, description)
VALUES (11, 'paper_positions + paper_trades: active_confluence_threshold, regime')
ON CONFLICT DO NOTHING;

COMMIT;
