From 129b97183a52465436bd55ad695efd883b02a321 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Thu, 12 Mar 2026 19:54:45 +0100 Subject: [PATCH] Use fully qualified table names in ClickHouse init scripts ClickHouse Docker entrypoint runs init scripts against the default database, not the one specified by CLICKHOUSE_DB. Prefix all table names with cameleer3. to ensure they're created in the right database. Co-Authored-By: Claude Opus 4.6 --- deploy/clickhouse.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy/clickhouse.yaml b/deploy/clickhouse.yaml index 1d9784a5..1a889b60 100644 --- a/deploy/clickhouse.yaml +++ b/deploy/clickhouse.yaml @@ -5,7 +5,7 @@ metadata: namespace: cameleer data: 01-schema.sql: | - CREATE TABLE IF NOT EXISTS route_executions ( + CREATE TABLE IF NOT EXISTS cameleer3.route_executions ( execution_id String, route_id LowCardinality(String), agent_id LowCardinality(String), @@ -33,7 +33,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 +43,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 +58,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 +72,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