diff --git a/ee/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql b/ee/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql index 5d71aaad3..92e57f520 100644 --- a/ee/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql +++ b/ee/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql @@ -11,3 +11,19 @@ CREATE TABLE IF NOT EXISTS product_analytics.event_properties _timestamp DateTime DEFAULT now() ) ENGINE = ReplacingMergeTree(_timestamp) ORDER BY (project_id, event_name, property_name); + +DROP TABLE IF EXISTS product_analytics.all_events; +CREATE TABLE IF NOT EXISTS product_analytics.all_events +( + project_id UInt16, + auto_captured BOOL DEFAULT FALSE, + event_name String, + display_name String DEFAULT '', + description String DEFAULT '', + event_count_l30days UInt32 DEFAULT 0, + query_count_l30days UInt32 DEFAULT 0, + + created_at DateTime64, + _timestamp DateTime DEFAULT now() +) ENGINE = ReplacingMergeTree(_timestamp) + ORDER BY (project_id, auto_captured, event_name); \ No newline at end of file diff --git a/ee/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql b/ee/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql index 7824e7cdf..473614166 100644 --- a/ee/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql +++ b/ee/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql @@ -642,6 +642,7 @@ CREATE TABLE IF NOT EXISTS product_analytics.group_properties CREATE TABLE IF NOT EXISTS product_analytics.all_events ( project_id UInt16, + auto_captured BOOL DEFAULT FALSE, event_name String, display_name String DEFAULT '', description String DEFAULT '', @@ -651,7 +652,7 @@ CREATE TABLE IF NOT EXISTS product_analytics.all_events created_at DateTime64, _timestamp DateTime DEFAULT now() ) ENGINE = ReplacingMergeTree(_timestamp) - ORDER BY (project_id, event_name); + ORDER BY (project_id, auto_captured, event_name); -- The full list of event-properties (used to tell which property belongs to which event) diff --git a/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql b/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql index ff47294b7..e49bda06a 100644 --- a/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql +++ b/scripts/schema/db/init_dbs/clickhouse/1.23.0/1.23.0.sql @@ -22,3 +22,19 @@ CREATE TABLE IF NOT EXISTS product_analytics.event_properties _timestamp DateTime DEFAULT now() ) ENGINE = ReplacingMergeTree(_timestamp) ORDER BY (project_id, event_name, property_name); + +DROP TABLE IF EXISTS product_analytics.all_events; +CREATE TABLE IF NOT EXISTS product_analytics.all_events +( + project_id UInt16, + auto_captured BOOL DEFAULT FALSE, + event_name String, + display_name String DEFAULT '', + description String DEFAULT '', + event_count_l30days UInt32 DEFAULT 0, + query_count_l30days UInt32 DEFAULT 0, + + created_at DateTime64, + _timestamp DateTime DEFAULT now() +) ENGINE = ReplacingMergeTree(_timestamp) + ORDER BY (project_id, auto_captured, event_name); \ No newline at end of file diff --git a/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql b/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql index 8d228868e..1816515c3 100644 --- a/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql +++ b/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql @@ -504,6 +504,7 @@ CREATE TABLE IF NOT EXISTS product_analytics.group_properties CREATE TABLE IF NOT EXISTS product_analytics.all_events ( project_id UInt16, + auto_captured BOOL DEFAULT FALSE, event_name String, display_name String DEFAULT '', description String DEFAULT '', @@ -513,7 +514,7 @@ CREATE TABLE IF NOT EXISTS product_analytics.all_events created_at DateTime64, _timestamp DateTime DEFAULT now() ) ENGINE = ReplacingMergeTree(_timestamp) - ORDER BY (project_id, event_name); + ORDER BY (project_id, auto_captured, event_name); -- The full list of event-properties (used to tell which property belongs to which event) CREATE TABLE IF NOT EXISTS product_analytics.event_properties