How to Compare Database Schemas Before Deploying
A step-by-step workflow for catching schema drift between staging and production.
Paste two schema exports from your PlanetScale branches or deploy requests. Spot every table, column, index, and constraint change instantly. Get ready-to-run ALTER TABLE scripts — all in your browser.
No account required. No data leaves your device.
SchemaLens understands MySQL-specific syntax that generic diff tools miss — perfect for PlanetScale's branching and deploy request model.
Compare schemas across PlanetScale branches. Export from your main branch and a feature branch to see exactly what schema changes a deploy request introduces.
Validate schema changes before opening a PlanetScale deploy request. Catch missing indexes, column type mismatches, and breaking changes before they reach production.
Generates MySQL-compatible ALTER TABLE scripts that work with PlanetScale's online schema change workflow. No table locks, no downtime.
Primary keys, unique constraints, and CHECK constraints — all compared semantically. Note: PlanetScale does not support foreign keys; SchemaLens flags their absence.
Detects CREATE VIEW changes. Understands PlanetScale's supported trigger syntax. Essential for projects using views for computed data.
Your schema never leaves the browser. Compare production PlanetScale schemas safely without uploading sensitive table structures to a third-party server.
Use the PlanetScale Console to export schema from two branches, or run mysqldump --no-data against your branch connection strings.
Copy the SQL into the two editor panes. Dialect is automatically set to MySQL (PlanetScale's engine).
See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Breaking changes flagged in red.
Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Apply via PlanetScale deploy requests or your migration tool.
SchemaLens generates production-ready ALTER TABLE scripts for every change it detects in your PlanetScale project.
ALTER TABLE `users`
MODIFY COLUMN `bio` VARCHAR(500);
ALTER TABLE `orders`
ADD COLUMN `shipped_at` DATETIME;
ALTER TABLE `users`
ADD CONSTRAINT `uq_users_email`
UNIQUE (`email`);
CREATE INDEX `idx_orders_user_id`
ON `orders`(`user_id`);
SchemaLens runs in your browser and works with any PlanetScale project — no CLI setup required.
db dumpA step-by-step workflow for catching schema drift between staging and production.
8 practical differences that trip up developers switching between the two databases.
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.