diff --git a/sql/20231031110543_update_event.up.sql b/sql/20231031110543_update_event.up.sql index 5f82fdc4..2e75f0f6 100644 --- a/sql/20231031110543_update_event.up.sql +++ b/sql/20231031110543_update_event.up.sql @@ -12,11 +12,24 @@ CREATE TABLE IF NOT EXISTS new_events ( Event String, FirstTime String, LastTime String +) CREATE TABLE IF NOT EXISTS new_events ( + ClusterName String, + Id String, + EventTime DateTime('UTC'), + OpType String, + Name String, + Namespace String, + Kind String, + Message String, + Reason String, + Host String, + Event String, + FirstTime String, + LastTime String ) ENGINE = MergeTree() -ORDER BY ClusterName, EventTime; +ORDER BY ClusterName, EventTime +TTL EventTime + INTERVAL 30 DAY; -TTL EventTime + INTERVAL 30 DAY -SETTINGS index_granularity = 8192; INSERT INTO new_events SELECT * FROM events;