ALTER TABLE recommendation
    ADD COLUMN IF NOT EXISTS opportunity_level TEXT DEFAULT '',
    ADD COLUMN IF NOT EXISTS opportunity_level_label TEXT DEFAULT '',
    ADD COLUMN IF NOT EXISTS holding_horizon TEXT DEFAULT '',
    ADD COLUMN IF NOT EXISTS entry_model TEXT DEFAULT '',
    ADD COLUMN IF NOT EXISTS stop_model TEXT DEFAULT '',
    ADD COLUMN IF NOT EXISTS tp_model TEXT DEFAULT '';

CREATE INDEX IF NOT EXISTS idx_rec_opportunity_level_time
    ON recommendation(opportunity_level, rec_time DESC);
