mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
fix(clickhouse): remove unsupported MODIFY ORDER BY from migration
ClickHouse keeps the implicit PRIMARY KEY when shortening ORDER BY, which fails with "Primary key must be a prefix of the sorting key". TTL-only changes are safe and unblock goose startup; narrowing ORDER BY would require table recreation.
This commit is contained in:
@@ -15,10 +15,5 @@ ALTER TABLE of_node_obs_frps MODIFY TTL toDateTime(captured_at) + INTERVAL 30 DA
|
||||
|
||||
ALTER TABLE of_node_obs_frpc MODIFY TTL toDateTime(captured_at) + INTERVAL 30 DAY;
|
||||
|
||||
-- Narrow ORDER BY for node access logs to match common filter patterns.
|
||||
-- Requires ClickHouse 24.10+ (MODIFY ORDER BY). On older versions this statement
|
||||
-- may fail and require manual table recreation; TTL changes above are still safe.
|
||||
ALTER TABLE of_node_access_logs MODIFY ORDER BY (node_id, logged_at, status_code);
|
||||
|
||||
-- +goose Down
|
||||
-- TTL and ORDER BY changes cannot be safely reversed without recreating tables.
|
||||
-- TTL changes cannot be safely reversed without recreating tables.
|
||||
Reference in New Issue
Block a user