How to Compare Database Schemas Before Deploying
A step-by-step workflow for catching schema drift between staging and production.
Paste two SHOW CREATE TABLE outputs or system.tables DDL dumps. Spot every MergeTree column, partition key, ordering key, and materialized view change instantly. Get ready-to-run ALTER TABLE scripts for ClickHouse — all in your browser.
No account required. No data leaves your device.
SchemaLens understands ClickHouse-specific syntax that generic diff tools miss.
Compares MergeTree, ReplacingMergeTree, SummingMergeTree, AggregatingMergeTree, and ReplicatedMergeTree engine definitions across schema versions.
Correctly handles Int8/16/32/64, UInt8/16/32/64, Float32/64, Decimal, DateTime64, UUID, IPv4/IPv6, Nested, and Enum8/16 types.
Detects changes to PARTITION BY, ORDER BY, and PRIMARY KEY expressions that control data distribution and query performance.
Spots changes in CREATE MATERIALIZED VIEW definitions, TO target tables, and populates clauses that power real-time analytics pipelines.
Understands ClickHouse's sparse primary index model. Compares INDEX declarations, projection definitions, and skip indexes for query optimization.
Your schema never leaves the browser. Compare production ClickHouse schemas safely without uploading sensitive table structures to a third-party server.
Run SHOW CREATE TABLE db.table or query system.tables on both ClickHouse clusters.
Copy the SQL into the two editor panes. Select MySQL dialect — ClickHouse DDL is closest to MySQL syntax.
See added tables, dropped columns, type changes, engine modifications, and partition key changes highlighted in color.
Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Apply to staging, then production.
SchemaLens generates production-ready ALTER TABLE scripts for every change it detects.
ALTER TABLE events
ADD COLUMN revenue Decimal(18, 2);
ALTER TABLE events
MODIFY COLUMN event_time DateTime64(3);
ALTER TABLE events
ADD PROJECTION proj_daily
( SELECT toStartOfDay(event_time), count() GROUP BY day );
CREATE MATERIALIZED VIEW events_mv
TO events_summary
AS SELECT ...
A step-by-step workflow for catching schema drift between staging and production.
Automated checks and manual review processes to prevent broken deployments.
Learn how to catch dropped columns, missing indexes, and type changes before they cause incidents.
Join thousands of developers who use SchemaLens to catch schema changes before they hit production.
Start Comparing FreeFree for up to 10 tables. Pro starts at $12/mo.