Use fully qualified table names in ClickHouse init scripts
All checks were successful
CI / build (push) Successful in 49s
CI / docker (push) Successful in 40s
CI / deploy (push) Successful in 13s

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 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-12 19:54:45 +01:00
parent 28536cc807
commit 129b97183a

View File

@@ -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