Phoenix schema diff — free to use

Phoenix Schema Diff.
Compare Ecto migrations.
Zero setup.

Paste two CREATE TABLE dumps from your Phoenix app — whether from mix ecto.dump, pg_dump --schema-only, or raw SQL exports from PostgreSQL. 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 Phoenix & Ecto workflows

SchemaLens understands Elixir-specific patterns that generic diff tools miss.

💧

Ecto Migration Diff

Compare mix ecto.migrate outputs before and after schema changes. Verify that your migration scripts match the Ecto.Schema definitions exactly before deploying to production.

📐

Schema Field Validation

Detects field :name, :stringfield :name, :citext, precision changes on :decimal fields, and null: false additions that break existing Repo.insert! calls.

🗂️

Index & Unique Constraint

Diffs create index(), unique_index(), and create constraint() declarations in migrations. Catches missing indexes that could slow down Ecto query performance.

🔗

Association Validation

Validates belongs_to, has_many, and many_to_many foreign key constraints. Detects missing or changed references that could break Ecto preload and association queries.

🧬

Context Module Isolation

Compares schemas across Phoenix Context boundaries. Detects when a shared table schema diverges between contexts like Accounts.User and Profiles.User.

🔒

Privacy First

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

How it works with Phoenix

1

Dump your schemas

Run mix ecto.dump or pg_dump --schema-only on both environments (local vs staging, or staging vs production).

2

Paste into SchemaLens

Copy the SQL into the two editor panes. Dialect auto-detects PostgreSQL — the default and most common database for Phoenix applications.

3

Review the diff

See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Check for breaking changes before your next mix phx.server deploy.

4

Copy the migration

Export ALTER TABLE scripts, save as Markdown for PR descriptions, or generate rollback SQL. Run in staging, then production.

Phoenix migration examples

SchemaLens generates production-ready ALTER TABLE scripts for every change it detects.

Add a new column

ALTER TABLE users
  ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;

Change to citext for case-insensitive

ALTER TABLE users
  ALTER COLUMN email TYPE CITEXT;

Add a foreign key

ALTER TABLE orders
  ADD CONSTRAINT fk_orders_user_id
  FOREIGN KEY (user_id) REFERENCES users(id)
  ON DELETE CASCADE;

Add a unique index

CREATE UNIQUE INDEX users_email_index
  ON users (email);

Related guides

Ready to diff your Phoenix schemas?

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

Start Comparing Free

Free for up to 15 tables. Lifetime Pro — $39 once.