How to Compare Database Schemas Before Deploying
A step-by-step workflow for catching schema drift between staging and production.
Paste two pg_dump --schema-only outputs from your TimescaleDB instances. Spot every hypertable, column, index, and constraint change instantly. Get ready-to-run ALTER TABLE scripts for TimescaleDB — all in your browser.
No account required. No data leaves your device.
SchemaLens understands TimescaleDB-specific syntax that generic diff tools miss.
Compares CREATE TABLE definitions for hypertables, including time-series columns, partition keys, and space dimensions.
Correctly handles TIMESTAMPTZ, TIMESTAMP, INTERVAL, and custom time-series types across schema versions.
Primary keys, unique constraints, foreign keys, CHECK constraints, and time-optimized indexes — all compared semantically, not by raw text.
Detects changes in CREATE MATERIALIZED VIEW definitions for continuous aggregates, including column additions and filter modifications.
Because TimescaleDB is PostgreSQL under the hood, SchemaLens parses every hypertable, index, and constraint with full accuracy.
Your schema never leaves the browser. Compare production time-series schemas safely without uploading sensitive table structures to a third-party server.
Run pg_dump --schema-only old_db > old.sql on both TimescaleDB databases.
Copy the SQL into the two editor panes. Select PostgreSQL dialect — TimescaleDB is PostgreSQL-native.
See added hypertables, dropped columns, type changes, and constraint modifications highlighted in color.
Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Run in staging, then production.
SchemaLens generates production-ready ALTER TABLE scripts for every change it detects.
ALTER TABLE "metrics"
ADD COLUMN "cpu_temp" DOUBLE PRECISION;
ALTER TABLE "events"
ALTER COLUMN "metadata" TYPE JSONB;
CREATE INDEX "idx_metrics_device_time"
ON "metrics" ("device_id", "time" DESC);
ALTER TABLE "sensor_readings"
ADD CONSTRAINT "fk_sensor_device"
FOREIGN KEY ("device_id") REFERENCES "devices"("id");
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.