Supabase schema diff — free to use

Supabase Schema Diff.
Generate migrations.
Zero setup.

Paste two pg_dump --schema-only or supabase db dump outputs. Spot every table, column, index, RLS policy, and constraint change instantly. Get ready-to-run ALTER TABLE scripts for your Supabase project — all in your browser.

No account required. No data leaves your device.

Built for Supabase workflows

SchemaLens understands PostgreSQL-specific syntax that generic diff tools miss — perfect for Supabase projects.

Supabase Auth & Storage Schema

Diff schemas that include auth.users, storage.buckets, and custom tables. Understands Supabase's default schema layout.

🔐

RLS Policy Aware

Detects CREATE POLICY and ALTER POLICY changes. Catch row-level security drift between local and production environments.

📦

Enum & Custom Types

Diffs CREATE TYPE ... AS ENUM statements. Catches added or removed enum values before they break your Supabase client types.

🔑

Constraints & Indexes

Primary keys, unique constraints, foreign keys, CHECK constraints, and partial indexes — all compared semantically, not by raw text.

📝

Functions & Triggers

Detects CREATE FUNCTION and CREATE TRIGGER changes. Critical for Supabase projects that rely on database functions for webhooks and computed fields.

🔒

Privacy First

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

How it works

1

Export your Supabase schemas

Run supabase db dump or use the SQL Editor to export schema-only dumps from your local and production projects.

2

Paste into SchemaLens

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

3

Review the diff

See added tables, dropped columns, type changes, RLS policy modifications, and constraint changes highlighted in color.

4

Copy the migration

Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Apply via Supabase migrations or the SQL Editor.

Supabase migration examples

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

Add RLS policy

CREATE POLICY "Users can read own data"
  ON "public"."users"
  FOR SELECT
  USING (auth.uid() = id);

Add a new column

ALTER TABLE "orders"
  ADD COLUMN "shipped_at" TIMESTAMP;

Add a foreign key

ALTER TABLE "comments"
  ADD CONSTRAINT "fk_comments_post"
  FOREIGN KEY ("post_id") REFERENCES "posts"("id");

Create function for webhook

CREATE OR REPLACE FUNCTION "public"."notify_change"()
RETURNS TRIGGER AS $$ ... $$;

Supabase diff vs other tools

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

✅ SchemaLens

  • Browser-based — zero install
  • Works with any pg_dump or SQL export
  • Visual diff with color highlighting
  • Detects RLS policies, functions, triggers
  • Shareable diff URLs
  • Export to SQL, Markdown, PDF, Prisma, Drizzle

❌ Supabase CLI db diff

  • Requires CLI installation and login
  • Requires linked project
  • Text-only output
  • No RLS policy diff visualization
  • No shareable links
  • SQL output only

Related guides

Ready to diff your Supabase 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.