From 357bdefb8f2ef81f8a5ef8b920716f66cdda1074 Mon Sep 17 00:00:00 2001 From: John Richmond <5629+jr@users.noreply.github.com> Date: Fri, 30 May 2025 12:18:03 -0700 Subject: [PATCH] Add messages table to local clickhouse setup (#51) * Add messages table to local clickhouse setup Copied from production, using MergeTree() instead of SharedMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}'). This still only runs on a fresh setup (e.g. rm -rf .docker/clickhouse), so it's a poor substitute for actual migrations. * Update .docker/scripts/clickhouse/001-create-tables.sql Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Add local clickhouse url+password to development env --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- .../scripts/clickhouse/001-create-tables.sql | 21 ++++++++++++++++++- .env.development | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.docker/scripts/clickhouse/001-create-tables.sql b/.docker/scripts/clickhouse/001-create-tables.sql index c5ec52d986..6e3d3d1171 100644 --- a/.docker/scripts/clickhouse/001-create-tables.sql +++ b/.docker/scripts/clickhouse/001-create-tables.sql @@ -31,4 +31,23 @@ CREATE TABLE IF NOT EXISTS default.events ) ENGINE = MergeTree() ORDER BY (id, type, timestamp) -SETTINGS index_granularity = 8192; \ No newline at end of file +SETTINGS index_granularity = 8192; + +CREATE TABLE IF NOT EXISTS default.messages +( + `id` UUID, + `orgId` String, + `userId` String, + `taskId` String, + `ts` Int32, + `type` String, + `ask` Nullable(String), + `say` Nullable(String), + `text` Nullable(String), + `reasoning` Nullable(String), + `partial` Nullable(Bool), + `timestamp` Int32 +) +ENGINE = MergeTree() +ORDER BY (id, timestamp) +SETTINGS index_granularity = 8192; diff --git a/.env.development b/.env.development index 74cabaee61..8a065f1e7f 100644 --- a/.env.development +++ b/.env.development @@ -1 +1,3 @@ DATABASE_URL=postgres://postgres:password@localhost:5432/roo_code_development +CLICKHOUSE_URL=http://localhost:8123/default +CLICKHOUSE_PASSWORD=password