Files
zeekay bd6eef33a2 converge analytics OLAP onto one datastore client
One OLAP backend, one env var (DATASTORE_URL), one dispatch key (DATASTORE).
Fold the parallel clickhouse.ts client into datastore.ts — the superset:
IN-array equality, OR matching, cohort match, excludeBounce — and route the
11 report/performance/replay query files through [DATASTORE]. runQuery drops
the second CLICKHOUSE_URL switch that left those 11 files un-dispatched
(TypeError 500) under DATASTORE_URL.

Model cohortMatch/cohortActionName (QueryOptions) and paramName (Filter) in
the types the builders already use. Fix the analytics-vs-umami database
prefix in ClickHouse migrations 09/10 so the schema provisions against the
analytics database.
2026-07-23 02:48:09 -07:00

18 lines
491 B
SQL

-- Create session_replay
CREATE TABLE analytics.session_replay
(
replay_id UUID,
website_id UUID,
session_id UUID,
visit_id UUID,
chunk_index UInt32,
events String CODEC(ZSTD(3)),
event_count UInt32,
started_at DateTime64(6),
ended_at DateTime64(6),
created_at DateTime64(6) DEFAULT now64(6)
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(created_at)
ORDER BY (replay_id, website_id, session_id, visit_id, chunk_index)
SETTINGS index_granularity = 8192;