clickhouse-migrations

Create and alter ClickHouse tables with standard migration patterns and safety rules.

37.6k|3.2k|Updated Jan 23, 2020
One-click install
npx skills add https://github.com/PostHog/posthog --skill clickhouse-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clickhouse-migrations
Source: https://github.com/PostHog/posthog/tree/main/.claude/skills/clickhouse-migrations
Command: npx skills add https://github.com/PostHog/posthog --skill clickhouse-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

ClickHouse migrations are complex and error-prone; this Skill provides patterns and rules to standardize and safely perform migrations.

Core Features & Use Cases

  • Migration structure guidance for ClickHouse, including node roles and engine choices
  • Safe, repeatable migration rules and examples for both sharded and replicated setups
  • Use cases: creating a new table, altering replication, and avoiding risky operations

Quick Start

Run the migration pattern examples to structure a new ClickHouse migration file; refer to AGENTS.md in the references directory for examples and guidance.

Frequently Asked Questions about clickhouse-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely run ClickHouse migrations on a replicated cluster?

Safe ClickHouse migrations on replicated clusters require standard patterns like using IF EXISTS/IF NOT EXISTS and correctly flagging replication behavior during alterations to ensure repeatable schema changes across sharded and replicated nodes without risky operations.

Why should I avoid ON CLUSTER when altering ClickHouse tables?

Avoiding ON CLUSTER in ClickHouse migrations prevents unintended distributed execution errors by enforcing constraints that require correctly flagging replication behavior instead, ensuring safe management of distributed deployments without triggering risky operations.

What are the best practices for structuring ClickHouse migration files?

ClickHouse migration best practices involve following specific structural patterns for creating, altering, and maintaining tables by choosing correct node roles and engine choices for both sharded and replicated setups to ensure safe, repeatable deployments.

Does my ClickHouse sharded setup require special migration rules?

Sharded ClickHouse setups require specific migration rules to handle distributed deployments safely by applying standard patterns and safety rules that avoid risky operations like ON CLUSTER while ensuring correct replication behavior during table alterations.

How do I alter replication behavior safely in ClickHouse?

Altering ClickHouse replication behavior safely requires correctly flagging replication settings during table alterations, using concrete migration structure and guidance to standardize these changes across distributed and replicated clusters.

What is a safe pattern for creating new tables in distributed ClickHouse deployments?

Creating new tables in distributed ClickHouse deployments safely means using IF NOT EXISTS and selecting appropriate node roles and engines, applying standard patterns that prevent errors during sharded and replicated schema creation.