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>
This commit is contained in:
John Richmond 2025-05-30 12:18:03 -07:00 committed by GitHub
parent a5a3dba01d
commit 357bdefb8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View file

@ -31,4 +31,23 @@ CREATE TABLE IF NOT EXISTS default.events
)
ENGINE = MergeTree()
ORDER BY (id, type, timestamp)
SETTINGS index_granularity = 8192;
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;

View file

@ -1 +1,3 @@
DATABASE_URL=postgres://postgres:password@localhost:5432/roo_code_development
CLICKHOUSE_URL=http://localhost:8123/default
CLICKHOUSE_PASSWORD=password