ClickHouse can't rename columns that are part of ORDER BY keys. Updated V1-V8 DDL files directly with new column names (instance_id, application_id) and removed V9 migration. Wipe ClickHouse and restart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
491 B
SQL
13 lines
491 B
SQL
CREATE TABLE IF NOT EXISTS agent_events (
|
|
tenant_id LowCardinality(String) DEFAULT 'default',
|
|
timestamp DateTime64(3) DEFAULT now64(3),
|
|
instance_id LowCardinality(String),
|
|
application_id LowCardinality(String),
|
|
event_type LowCardinality(String),
|
|
detail String DEFAULT ''
|
|
)
|
|
ENGINE = MergeTree()
|
|
PARTITION BY (tenant_id, toYYYYMM(timestamp))
|
|
ORDER BY (tenant_id, application_id, instance_id, timestamp)
|
|
TTL toDateTime(timestamp) + INTERVAL 365 DAY DELETE;
|