ClickHouse Migrations

TypeScript-first ClickHouse schema migration tooling

Managing ClickHouse schema changes is harder than it looks. ALTER TABLE has constraints, distributed tables add complexity, and most migration tools were not built for ClickHouse. hypequery is building dedicated TypeScript migration tooling — reversible changes, version tracking, and CLI integration. Schema generation is available today.

Schema generation

Available now

Migrations

Coming soon

Language

TypeScript

ClickHouse ALTER TABLE has constraints other databases do not

You cannot change a column type in place. Materialized views, projections, and distributed tables all add coordination complexity. Most migration tools do not account for this and fail silently or require manual workarounds.

No standard migration tooling built for ClickHouse

Flyway and Liquibase support ClickHouse in theory but were designed for transactional databases. The ClickHouse-specific patterns — ReplicatedMergeTree, ON CLUSTER DDL, column codec changes — are not first-class.

Schema and TypeScript types drift after every change

After an ALTER TABLE runs, your TypeScript interfaces are wrong until someone hand-updates them. On a fast-moving team this is a constant source of silent bugs and runtime errors.

What is coming

ClickHouse-aware migrations that regenerate TypeScript types automatically

hypequery migrations will be built specifically for ClickHouse — understanding the ALTER TABLE constraints, ON CLUSTER DDL for distributed setups, and running type regeneration automatically after each migration so your schema.ts stays in sync without a manual step.

  • Migration files in TypeScript with up/down definitions
  • ClickHouse-aware schema operations — ADD COLUMN, MODIFY COLUMN where supported, and safe alternatives where not
  • Automatic TypeScript type regeneration after every migration run
  • Version tracking and migration history stored in ClickHouse
  • CLI integration with the existing @hypequery/cli toolchain

Preview API

TypeScript migration definition (coming soon)

what-is-coming.ts

This is a preview of the migrations API under development. The exact interface may change before release — star on GitHub to follow the design.

Available today

Schema generation keeps TypeScript types in sync right now

While full migration tooling is in development, schema generation is available today. Run it after any manual schema change and your TypeScript types update immediately — no hand-editing interfaces.

Teams currently using hypequery run schema generation as part of their deployment step. When a schema change lands in ClickHouse, the next generate run picks it up and updates every table and column type automatically.

Star on GitHub or watch the repository to be notified when migrations land. In the meantime, the quick start covers schema generation and typed queries.

Available now

Schema generation — keep types in sync after any change

available-today.ts

Run this after any ALTER TABLE or schema change. Your TypeScript types update to match the live ClickHouse schema — correct mappings for DateTime, UInt64, Nullable, and Decimal included.

Why teams search for this

Common implementation questions this page should solve

ClickHouse schema migration tools

Most migration tools (Flyway, Liquibase, golang-migrate) support ClickHouse at a basic level but do not account for ClickHouse-specific DDL constraints. hypequery migrations are aimed at the narrower problem TypeScript teams actually have: schema changes plus generated types that need to stay in sync.

ClickHouse ALTER TABLE TypeScript

When you run an ALTER TABLE in ClickHouse, your TypeScript types are immediately out of sync. hypequery schema generation fixes this today — run generate and your types update to match the live schema.

ClickHouse schema versioning

Versioning ClickHouse schema changes is harder than in transactional databases. The hypequery migrations approach stores version history in ClickHouse itself, making it visible alongside your analytics data.

ClickHouse DDL in TypeScript

Writing raw DDL strings for ClickHouse schema changes is error-prone and disconnected from your TypeScript codebase. hypequery migrations will expose a typed DDL API that integrates directly with schema generation.

Next step

Use schema generation while migrations are in development

Run npx @hypequery/cli generate to introspect your ClickHouse schema and generate TypeScript types today. Star on GitHub to follow migrations progress.