-- Migration 012: add variant column to execution_events

BEGIN;

ALTER TABLE execution_events
    ADD COLUMN IF NOT EXISTS variant VARCHAR(32) NOT NULL DEFAULT 'control';

CREATE INDEX IF NOT EXISTS idx_execution_events_variant_ts
    ON execution_events (variant, ts DESC);

INSERT INTO schema_versions (version, description)
VALUES (12, 'add variant column to execution_events')
ON CONFLICT DO NOTHING;

COMMIT;
