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 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: cameleer
|
namespace: cameleer
|
||||||
data:
|
data:
|
||||||
01-schema.sql: |
|
01-schema.sql: |
|
||||||
CREATE TABLE IF NOT EXISTS route_executions (
|
CREATE TABLE IF NOT EXISTS cameleer3.route_executions (
|
||||||
execution_id String,
|
execution_id String,
|
||||||
route_id LowCardinality(String),
|
route_id LowCardinality(String),
|
||||||
agent_id LowCardinality(String),
|
agent_id LowCardinality(String),
|
||||||
@@ -33,7 +33,7 @@ data:
|
|||||||
TTL toDateTime(start_time) + toIntervalDay(30)
|
TTL toDateTime(start_time) + toIntervalDay(30)
|
||||||
SETTINGS ttl_only_drop_parts = 1;
|
SETTINGS ttl_only_drop_parts = 1;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS route_diagrams (
|
CREATE TABLE IF NOT EXISTS cameleer3.route_diagrams (
|
||||||
content_hash String,
|
content_hash String,
|
||||||
route_id LowCardinality(String),
|
route_id LowCardinality(String),
|
||||||
agent_id LowCardinality(String),
|
agent_id LowCardinality(String),
|
||||||
@@ -43,7 +43,7 @@ data:
|
|||||||
ENGINE = ReplacingMergeTree(created_at)
|
ENGINE = ReplacingMergeTree(created_at)
|
||||||
ORDER BY (content_hash);
|
ORDER BY (content_hash);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS agent_metrics (
|
CREATE TABLE IF NOT EXISTS cameleer3.agent_metrics (
|
||||||
agent_id LowCardinality(String),
|
agent_id LowCardinality(String),
|
||||||
collected_at DateTime64(3, 'UTC'),
|
collected_at DateTime64(3, 'UTC'),
|
||||||
metric_name LowCardinality(String),
|
metric_name LowCardinality(String),
|
||||||
@@ -58,7 +58,7 @@ data:
|
|||||||
SETTINGS ttl_only_drop_parts = 1;
|
SETTINGS ttl_only_drop_parts = 1;
|
||||||
|
|
||||||
02-search-columns.sql: |
|
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_bodies String DEFAULT '',
|
||||||
ADD COLUMN IF NOT EXISTS exchange_headers String DEFAULT '',
|
ADD COLUMN IF NOT EXISTS exchange_headers String DEFAULT '',
|
||||||
ADD COLUMN IF NOT EXISTS processor_depths Array(UInt16) 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 processor_diagram_node_ids Array(String) DEFAULT [],
|
||||||
ADD COLUMN IF NOT EXISTS diagram_content_hash 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_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;
|
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;
|
ADD INDEX IF NOT EXISTS idx_error_stacktrace error_stacktrace TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 4;
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
|
|||||||
Reference in New Issue
Block a user