Skip to content

armgit / umami

Public Imported from GitHub
0

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.

update CH schema with upload_id

Francis Caoa5582416b3d7
diff --git a/db/clickhouse/migrations/02_add_upload_id.sql b/db/clickhouse/migrations/02_add_upload_id.sql
new file mode 100644
index 000000000..c14f5622e
--- /dev/null
+++ b/db/clickhouse/migrations/02_add_upload_id.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "website_event" ADD COLUMN "upload_id" UUID AFTER "created_at";
+ALTER TABLE "event_data" ADD COLUMN "upload_id" UUID AFTER "created_at";
\ No newline at end of file
diff --git a/db/clickhouse/schema.sql b/db/clickhouse/schema.sql
index de1082ecb..88d72db28 100644
--- a/db/clickhouse/schema.sql
+++ b/db/clickhouse/schema.sql
@@ -27,7 +27,8 @@ CREATE TABLE umami.website_event
--event
event_type UInt32,
event_name String,
- created_at DateTime('UTC')
+ created_at DateTime('UTC'),
+ upload_id UUID
)
engine = MergeTree
ORDER BY (website_id, session_id, created_at)
@@ -121,7 +122,8 @@ CREATE TABLE umami.event_data
numeric_value Nullable(Decimal64(4)), --922337203685477.5625
date_value Nullable(DateTime('UTC')),
data_type UInt32,
- created_at DateTime('UTC')
+ created_at DateTime('UTC'),
+ upload_id UUID
)
engine = MergeTree
ORDER BY (website_id, event_id, event_key, created_at)