-- Add prompt_preview and response_preview columns to ai_usage_logs
-- for audit logging (Task 3 - Ollama Security Hardening)

BEGIN;

ALTER TABLE ai_usage_logs
    ADD COLUMN IF NOT EXISTS prompt_preview VARCHAR(200),
    ADD COLUMN IF NOT EXISTS response_preview VARCHAR(200);

CREATE INDEX IF NOT EXISTS idx_ai_usage_logs_prompt_preview ON ai_usage_logs(prompt_preview) WHERE prompt_preview IS NOT NULL;

COMMIT;
