umami/db/clickhouse/schema.sql

53 lines
1.4 KiB
MySQL
Raw Normal View History

2022-09-12 18:55:34 +02:00
-- Create Event
2023-03-29 20:06:12 +02:00
CREATE TABLE umami.website_event
(
2022-10-09 01:12:33 +02:00
website_id UUID,
session_id UUID,
2024-03-21 17:30:42 +01:00
visit_id UUID,
2023-03-23 07:02:37 +01:00
event_id UUID,
--sessions
hostname LowCardinality(String),
browser LowCardinality(String),
os LowCardinality(String),
device LowCardinality(String),
screen LowCardinality(String),
language LowCardinality(String),
2022-09-12 18:55:34 +02:00
country LowCardinality(String),
subdivision1 LowCardinality(String),
2023-02-16 18:52:07 +01:00
subdivision2 LowCardinality(String),
2023-02-15 18:40:49 +01:00
city String,
--pageviews
2023-03-15 01:27:17 +01:00
url_path String,
url_query String,
referrer_path String,
referrer_query String,
referrer_domain String,
2023-02-15 18:40:49 +01:00
page_title String,
--events
event_type UInt32,
2022-09-12 18:55:34 +02:00
event_name String,
2023-06-26 17:19:52 +02:00
created_at DateTime('UTC'),
2023-06-26 19:32:23 +02:00
job_id UUID
)
2022-09-12 18:55:34 +02:00
engine = MergeTree
2022-10-12 06:02:15 +02:00
ORDER BY (website_id, session_id, created_at)
SETTINGS index_granularity = 8192;
2023-03-23 07:02:37 +01:00
CREATE TABLE umami.event_data
(
website_id UUID,
session_id UUID,
event_id UUID,
url_path String,
event_name String,
event_key String,
string_value Nullable(String),
2023-07-07 06:02:56 +02:00
number_value Nullable(Decimal64(4)), --922337203685477.5625
date_value Nullable(DateTime('UTC')),
data_type UInt32,
2023-06-26 17:19:52 +02:00
created_at DateTime('UTC'),
2023-06-26 19:32:23 +02:00
job_id UUID
2023-03-23 07:02:37 +01:00
)
engine = MergeTree
ORDER BY (website_id, event_id, event_key, created_at)
2023-12-27 18:22:32 +01:00
SETTINGS index_granularity = 8192;