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 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.
SchemaLens understands PostgreSQL-specific syntax that generic diff tools miss — perfect for Supabase projects.
Diff schemas that include auth.users, storage.buckets, and custom tables. Understands Supabase's default schema layout.
Detects CREATE POLICY and ALTER POLICY changes. Catch row-level security drift between local and production environments.
Diffs CREATE TYPE ... AS ENUM statements. Catches added or removed enum values before they break your Supabase client types.
Primary keys, unique constraints, foreign keys, CHECK constraints, and partial indexes — all compared semantically, not by raw text.
Detects CREATE FUNCTION and CREATE TRIGGER changes. Critical for Supabase projects that rely on database functions for webhooks and computed fields.
Your schema never leaves the browser. Compare production Supabase schemas safely without uploading sensitive table structures to a third-party server.
Run supabase db dump or use the SQL Editor to export schema-only dumps from your local and production projects.
Copy the SQL into the two editor panes. Dialect is automatically set to PostgreSQL (Supabase's engine).
See added tables, dropped columns, type changes, RLS policy modifications, and constraint changes highlighted in color.
Export ALTER TABLE scripts, save as Markdown, PDF, or raw SQL. Apply via Supabase migrations or the SQL Editor.
SchemaLens generates production-ready ALTER TABLE scripts for every change it detects in your Supabase project.
CREATE POLICY "Users can read own data"
ON "public"."users"
FOR SELECT
USING (auth.uid() = id);
ALTER TABLE "orders"
ADD COLUMN "shipped_at" TIMESTAMP;
ALTER TABLE "comments"
ADD CONSTRAINT "fk_comments_post"
FOREIGN KEY ("post_id") REFERENCES "posts"("id");
CREATE OR REPLACE FUNCTION "public"."notify_change"()
RETURNS TRIGGER AS $$ ... $$;
SchemaLens runs in your browser and works with any Supabase project — no CLI setup required.
db diffA 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.