Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
add session replay to CH schema
Francis Cao3c3409e63197
diff --git a/db/clickhouse/migrations/10_add_session_recording.sql b/db/clickhouse/migrations/10_add_session_recording.sqlnew file mode 100644index 000000000..b873bfc5f--- /dev/null+++ b/db/clickhouse/migrations/10_add_session_recording.sql@@ -0,0 +1,17 @@+-- Create session_replay+CREATE TABLE umami.session_replay+(+ replay_id UUID,+ website_id UUID,+ session_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, chunk_index)+SETTINGS index_granularity = 8192;\ No newline at end of filediff --git a/db/clickhouse/schema.sql b/db/clickhouse/schema.sqlindex a16faa58c..18f634563 100644--- a/db/clickhouse/schema.sql+++ b/db/clickhouse/schema.sql@@ -354,3 +354,21 @@ SELECTtoStartOfHour(created_at) as created_atFROM umami.website_performanceGROUP BY website_id, url_path, toStartOfHour(created_at);++-- Create session_replay+CREATE TABLE umami.session_replay+(+ replay_id UUID,+ website_id UUID,+ session_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, chunk_index)+SETTINGS index_granularity = 8192;\ No newline at end of file