Django schema diff — free to use

Django Schema Diff.
Compare model changes.
Zero setup.

Paste two python manage.py sqlmigrate outputs or raw CREATE TABLE dumps from your Django app. Spot every table, column, index, and constraint change instantly. Get ready-to-run ALTER TABLE scripts for PostgreSQL or MySQL — all in your browser.

No account required. No data leaves your device.

Built for Django & ORM workflows

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

🐍

Migration SQL Review

Compare the output of manage.py sqlmigrate before and after model changes. Verify that makemigrations produced exactly the schema you expected.

📋

Model Field Changes

Detects CharFieldTextField, IntegerFieldBigIntegerField, and nullability changes. Warns when max_length reductions could truncate data.

🗂️

Model Meta & Constraints

Diffs unique_together, indexes, constraints, and db_table changes in your Model Meta. Catches schema drift that Django's built-in diff misses.

🔗

Foreign Key & M2M

Validates ForeignKey, OneToOneField, and ManyToManyField changes. Detects missing on_delete behaviors and through-table modifications.

🧬

Abstract Base Models

Detects changes inherited from abstract base models (TimeStampedModel, SoftDeleteModel). Catches when a base model change propagates unexpectedly.

🔒

Privacy First

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

How it works with Django

1

Export your schemas

Run python manage.py dbshell -c "\\dt" and export with pg_dump --schema-only (PostgreSQL) or mysqldump --no-data (MySQL).

2

Paste into SchemaLens

Copy the SQL into the two editor panes. Dialect auto-detects PostgreSQL or MySQL based on your Django DATABASES config.

3

Review the diff

See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Check for breaking changes before running migrate.

4

Copy the migration

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

Django migration examples

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

Increase CharField max_length

ALTER TABLE "blog_post"
  ALTER COLUMN "title" TYPE VARCHAR(200);

Add a new field

ALTER TABLE "orders"
  ADD COLUMN "tracking_number" VARCHAR(100) NULL;

Add unique constraint

ALTER TABLE "users"
  ADD CONSTRAINT "users_email_unique"
  UNIQUE ("email");

Add index for query optimization

CREATE INDEX "orders_status_idx"
  ON "orders" ("status");

Related guides

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