PlanetScale schema diff — free to use

PlanetScale Schema Diff.
Generate migrations.
Zero setup.

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.

Built for PlanetScale workflows

SchemaLens understands MySQL-specific syntax that generic diff tools miss — perfect for PlanetScale's branching and deploy request model.

🌿

Branch-to-Branch Diff

Compare schemas across PlanetScale branches. Export from your main branch and a feature branch to see exactly what schema changes a deploy request introduces.

Deploy Request Aware

Validate schema changes before opening a PlanetScale deploy request. Catch missing indexes, column type mismatches, and breaking changes before they reach production.

📦

Online Schema Change Safe

Generates MySQL-compatible ALTER TABLE scripts that work with PlanetScale's online schema change workflow. No table locks, no downtime.

🔑

Constraints & Indexes

Primary keys, unique constraints, and CHECK constraints — all compared semantically. Note: PlanetScale does not support foreign keys; SchemaLens flags their absence.

📝

Views & Triggers

Detects CREATE VIEW changes. Understands PlanetScale's supported trigger syntax. Essential for projects using views for computed data.

🔒

Privacy First

Your schema never leaves the browser. Compare production PlanetScale schemas safely without uploading sensitive table structures to a third-party server.

How it works

1

Export your PlanetScale schemas

Use the PlanetScale Console to export schema from two branches, or run mysqldump --no-data against your branch connection strings.

2

Paste into SchemaLens

Copy the SQL into the two editor panes. Dialect is automatically set to MySQL (PlanetScale's engine).

3

Review the diff

See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Breaking changes flagged in red.

4

Copy the migration

Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Apply via PlanetScale deploy requests or your migration tool.

PlanetScale migration examples

SchemaLens generates production-ready ALTER TABLE scripts for every change it detects in your PlanetScale project.

Column type change

ALTER TABLE `users`
  MODIFY COLUMN `bio` VARCHAR(500);

Add a new column

ALTER TABLE `orders`
  ADD COLUMN `shipped_at` DATETIME;

Add a unique constraint

ALTER TABLE `users`
  ADD CONSTRAINT `uq_users_email`
  UNIQUE (`email`);

Create index for performance

CREATE INDEX `idx_orders_user_id`
  ON `orders`(`user_id`);

PlanetScale diff vs other tools

SchemaLens runs in your browser and works with any PlanetScale project — no CLI setup required.

✅ SchemaLens

  • Browser-based — zero install
  • Works with any schema export or dump
  • Visual diff with color highlighting
  • Branch-to-branch comparison support
  • Shareable diff URLs
  • Export to SQL, Markdown, PDF, Prisma, Drizzle

❌ PlanetScale CLI db dump

  • Requires CLI installation and login
  • Requires service token or OAuth
  • Text-only output
  • No visual branch comparison
  • No shareable links
  • SQL output only

Related guides

Ready to diff your PlanetScale schemas?

Join thousands of developers who use SchemaLens to catch schema changes before they hit production.

Start Comparing Free

Free for up to 10 tables. Pro starts at $12/mo.