clickhouse-migrations
ClickHouse migration patterns and rules. Use when creating or modifying ClickHouse migrations.
Install
git clone https://github.com/PostHog/posthog /tmp/posthog && ln -s /tmp/posthog/.agents/skills/clickhouse-migrations ~/.claude/skills/clickhouse-migrations
From README
ClickHouse Migrations Read posthog/clickhouse/migrations/AGENTS.md for comprehensive patterns, cluster , examples, and ingestion layer details. Quick reference Migration structure Node roles (choose by the cluster that owns the object) Only the members of NodeRole in posthog/clickhouse/client/connection.py are valid: ALL, DATA, INGESTIONEVENTS, INGESTIONSMALL, INGESTIONMEDIUM, ENDPOINTS, LOGS, APM, AIEVENTS, AUX, BATCHEXPORTS, OPS, SESSIONS. A name that is not in that enum fails at import, which aborts migration discovery and takes every job that runs migrations down with it. Pick the role by which cluster owns the object, not by its type alone: [NodeRole.DATA]: objects that belong on the main cluster — sharded tables, the Distributed read tables in front of sharded or satellite tables, views, dictionaries. A non-sharded replicated table on DATA keeps a full copy on every main-cluster node, so it is the wrong home for a product rollup or pre-aggregate (see below).
