diff --git a/deploy/clickhouse.yaml b/deploy/clickhouse.yaml index 339b2026..5fcfc51b 100644 --- a/deploy/clickhouse.yaml +++ b/deploy/clickhouse.yaml @@ -5,7 +5,9 @@ metadata: namespace: cameleer data: 01-schema.sql: | - CREATE TABLE IF NOT EXISTS route_executions ( + CREATE DATABASE IF NOT EXISTS cameleer3; + + CREATE TABLE IF NOT EXISTS cameleer3.route_executions ( execution_id String, route_id LowCardinality(String), agent_id LowCardinality(String), @@ -33,7 +35,7 @@ data: TTL toDateTime(start_time) + toIntervalDay(30) SETTINGS ttl_only_drop_parts = 1; - CREATE TABLE IF NOT EXISTS route_diagrams ( + CREATE TABLE IF NOT EXISTS cameleer3.route_diagrams ( content_hash String, route_id LowCardinality(String), agent_id LowCardinality(String), @@ -43,7 +45,7 @@ data: ENGINE = ReplacingMergeTree(created_at) ORDER BY (content_hash); - CREATE TABLE IF NOT EXISTS agent_metrics ( + CREATE TABLE IF NOT EXISTS cameleer3.agent_metrics ( agent_id LowCardinality(String), collected_at DateTime64(3, 'UTC'), metric_name LowCardinality(String), @@ -58,7 +60,7 @@ data: SETTINGS ttl_only_drop_parts = 1; 02-search-columns.sql: | - ALTER TABLE route_executions + ALTER TABLE cameleer3.route_executions ADD COLUMN IF NOT EXISTS exchange_bodies String DEFAULT '', ADD COLUMN IF NOT EXISTS exchange_headers String DEFAULT '', ADD COLUMN IF NOT EXISTS processor_depths Array(UInt16) DEFAULT [], @@ -72,11 +74,11 @@ data: ADD COLUMN IF NOT EXISTS processor_diagram_node_ids Array(String) DEFAULT [], ADD COLUMN IF NOT EXISTS diagram_content_hash String DEFAULT ''; - ALTER TABLE route_executions + ALTER TABLE cameleer3.route_executions ADD INDEX IF NOT EXISTS idx_exchange_bodies exchange_bodies TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 4, ADD INDEX IF NOT EXISTS idx_exchange_headers exchange_headers TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 4; - ALTER TABLE route_executions + ALTER TABLE cameleer3.route_executions ADD INDEX IF NOT EXISTS idx_error_stacktrace error_stacktrace TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 4; --- apiVersion: apps/v1