From 79f4b523ac33d14ca1acb42d52729dbab712568f Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 29 Aug 2024 17:13:05 +0100 Subject: [PATCH] Added analytics_events tinybird datasource ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd ref https://www.tinybird.co/docs/concepts/data-sources - This is our main datasource, where we'll store events that come in as people browse around Ghost - It's defined using tinybird's format, and then deployed out to tinybird using `tb deploy` --- .../datasources/analytics_events.datasource | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ghost/tinybird/datasources/analytics_events.datasource diff --git a/ghost/tinybird/datasources/analytics_events.datasource b/ghost/tinybird/datasources/analytics_events.datasource new file mode 100644 index 0000000000..a812f3a48f --- /dev/null +++ b/ghost/tinybird/datasources/analytics_events.datasource @@ -0,0 +1,14 @@ +DESCRIPTION > + Analytics events landing data source + +SCHEMA > + `timestamp` DateTime `json:$.timestamp`, + `session_id` String `json:$.session_id`, + `action` LowCardinality(String) `json:$.action`, + `version` LowCardinality(String) `json:$.version`, + `payload` String `json:$.payload` + +ENGINE MergeTree +ENGINE_PARTITION_KEY toYYYYMM(timestamp) +ENGINE_SORTING_KEY timestamp +ENGINE_TTL timestamp + toIntervalDay(60)