CREATE DATABASE IF NOT EXISTS analytics;

CREATE TABLE IF NOT EXISTS analytics.agent_score_events (
    event_time DateTime DEFAULT now(),
    tenant_id String,
    call_id String,
    agent_id String,
    quality_score Float64,
    compliance_score Float64,
    issues_json String
)
ENGINE = MergeTree
ORDER BY (tenant_id, agent_id, event_time);
