๐Ÿ Final Week โ€” Lifetime Pro $39 until July 10. Claim yours โ†’

Schema Diff Pre-commit Hook Generator

Stop breaking schema changes before they leave your machine. Generate a pre-commit hook that diffs your old and new schema files on every commit โ€” locally, privately, and for free.

๐Ÿ”ง Configure your hook

The schema file at the base branch or previous state.
The schema file in your working tree. Can be the same path if it changes during development.
Plain git hook works in any repo. pre-commit framework is for Python/pre-commit users and keeps hooks versioned.

โšก How to install

1

Save the hook

For the plain git hook, save it to .git/hooks/pre-commit and make it executable: chmod +x .git/hooks/pre-commit. For the pre-commit framework, add the YAML to .pre-commit-config.yaml.

2

Commit a schema change

The hook runs automatically when you commit any file. It diffs your configured schema paths and prints a summary to your terminal.

3

Block breaking changes

With "Fail on breaking" enabled, the commit is rejected if SchemaLens detects dropped tables, columns, or other risky changes.

๐Ÿ›ก๏ธ What it catches

๐Ÿ”ด Breaking changes

Dropped tables, dropped columns, type changes, and removed constraints block the commit.

๐ŸŸก Safe migrations

Added tables, columns, and indexes pass through with a clear report.

๐Ÿ“Š Risk score

Every diff gets a 0โ€“100 risk score so reviewers know what to prioritize.

๐Ÿ”’ Privacy first

Schema files are sent to SchemaLens for diffing; no database connection required.

Want schema diff checks on every pull request?

The free SchemaLens GitHub Action comments schema diffs directly on PRs โ€” no local setup required.

Add the GitHub Action โ†’ See Team plan