๐Ÿš€ SchemaLens is free forever. Upgrade to Lifetime Pro for $39 โ€” or get Pro free by sharing โ†’

๐Ÿš€ Add to your workflow โ€” copy, paste, done

Free for open source and small teams. Upgrade to Team for Slack alerts, shared dashboards, and unlimited members.

# .github/workflows/schema-diff.yml name: Schema Diff on: [pull_request] jobs: diff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: aimadetools/race-kimi@v1.0.2 with: old-schema-path: ./schema/base.sql new-schema-path: ./schema/current.sql dialect: postgres post-comment: true create-check-run: true run-only-on-schema-change: true # skip CI when no .sql files changed github-token: ${{ secrets.GITHUB_TOKEN }} fail-on-breaking: true
๐Ÿš€ Add from Actions tab ๐Ÿ‘๏ธ Live Demo โšก Setup Wizard auto-detects schema files GitHub-only wizard All platforms in 60s Try on a public PR

Free forever in CI/CD. Upgrade only when you need power features.

Free

Full diff, migration SQL, rollback, PR comments, Check Runs, Job Summary, and free Slack/Teams drift alerts.

Pro โ€” $39 lifetime

Saved diff history, shareable links, all 80+ micro-tools, no exit-intent nags, and priority support.

Team โ€” $29/mo

Shared workspace, 90-day persisted alert history, admin controls, and unlimited members.

Compare plans โ†’ Start Team plan โ†’
Even faster: Add the SchemaLens starter workflow directly from the Actions โ†’ New workflow tab in your repo. View template โ†’
Add SchemaLens to your repo in 30 seconds โ€” pick the starter workflow from the Actions tab

Pick the template, commit the workflow, and get schema diff reports on every pull request.

๐Ÿš€ Add starter workflow to your repo
Prefer zero config? Try the SchemaLens GitHub App โ€” it comments schema diffs on every PR without a workflow file.

โœ… What the PR Check Run looks like

SchemaLens Schema Diff โ€” Successful in 2s

Risk: Medium (42/100) ยท Breaking: 1

SchemaLens detected 1 added, 0 removed, and 2 modified tables. Risk level: Medium (42/100). 1 breaking change(s) found.

ALTER TABLE users
  ADD COLUMN email_verified_at TIMESTAMP;

-- ... 12 total migration lines.

๐Ÿ’ก Full migration SQL is free in every PR. Upgrade to Team for drift alerts โ†’

๐Ÿ“‹ What the Job Summary looks like

๐Ÿ” SchemaLens Schema Diff Report

๐ŸŸข Tables Added1
๐Ÿ”ด Tables Removed0
๐ŸŸก Tables Modified2
โš ๏ธ Breaking Changes1
๐Ÿ“Š Risk Score42/100 (Medium)

Generated Migration

ALTER TABLE users
  ADD COLUMN email_verified_at TIMESTAMP;

๐Ÿ’ก Full migration SQL is free in every PR. Upgrade to Team for drift alerts โ†’

Generated by SchemaLens GitHub Action

๐Ÿ’ฌ What the PR comment looks like

SL
SchemaLens Bot
commented 2 minutes ago

๐Ÿ” SchemaLens Schema Diff

Risk: Medium (42/100) | Breaking changes: 1

Migration Preview

ALTER TABLE users
  ADD COLUMN email_verified_at TIMESTAMP;

-- ... 12 total migration lines.

๐Ÿ’ก Full migration SQL is free in every PR. Upgrade to Team for drift alerts โ†’

Generated by SchemaLens GitHub Action

๐Ÿ”ด See it live on our repo

We use the SchemaLens GitHub Action on this very repository. Every time we update the demo schema files, the action runs and posts a diff summary.

๐Ÿ‘๏ธ See Live Demo Interactive PR Demo Chrome Extension PR Demo Bookmarklet โ–ถ View Live Action Runs ๐Ÿ“„ Demo Schema v1

Open a pull request that changes demo/schema-v2.sql to see the PR comment in action.

Why add schema diff to CI?

๐Ÿ›ก๏ธ Prevent production incidents

Breaking changes like dropped columns, removed indexes, or altered constraints get flagged before merge โ€” not after deploy.

โœ… Native PR Checks

Create a real GitHub Check Run that appears in the PR checks tab โ€” just like your test suite. Team members see risk scores and migration previews without leaving GitHub.

๐Ÿ“‹ Rich Job Summary

Every run generates a markdown summary on the Actions run page with tables, risk scores, full migration SQL, and Team upgrade CTAs. No clicking required.

๐Ÿ“„ Self-Contained HTML Report

Set upload-report: true to generate a beautiful HTML report artifact. Download it, share it, open it offline โ€” includes risk score, breaking changes, migration SQL, and rollback SQL. Learn more โ†’ What's a schema diff report? โ†’

๐Ÿ’ฌ PR comments, automatically

Every pull request gets a clear schema diff summary posted as a comment. Reviewers see exactly what changed.

โญ๏ธ Smart Skip

Set run-only-on-schema-change: true and the action skips entirely when no .sql files were modified โ€” saving CI minutes and reducing noise.

โšก Zero setup required

No database connections, no CLI installation, no license key. Just point the action at two SQL files.

๐Ÿšฆ Fail the build on breaking changes

Set fail-on-breaking: true and the workflow fails if any dangerous schema changes are detected.

๐Ÿ“Š Risk score at a glance

Each diff gets a 0-100 risk score. High-risk migrations get extra scrutiny in code review.

๐Ÿ”“ 100% free for every repo

The action includes breaking change detection, risk scoring, PR comments, Check Runs, Job Summaries, and full migration SQL. No license key required.

How it works

1

Dump your schema

Export your database schema to a SQL file as part of your workflow (e.g., pg_dump --schema-only or commit your schema file).

2

Compare before and after

The action compares the schema from your base branch against the schema in the PR. Any drift is surfaced instantly.

3

Get a PR comment with the diff

Enable post-comment: true and the action posts a formatted summary directly on the pull request.

๐Ÿšจ Schema Drift Alerts

Send every diff result to the SchemaLens hosted webhook and get rich alerts in Slack or Microsoft Teams โ€” plus a shareable alert page your whole team can view. Free tier includes alerts, shareable URLs, and local dashboard history. Team tier adds persisted server-side history and higher rate limits.

# Add to your workflow โ€” no license key required for free alerts - uses: aimadetools/race-kimi@v1.0.2 with: old-schema-path: ./schema/base.sql new-schema-path: ./schema/current.sql schema-drift-webhook: https://schemalens.tech/api/schema-drift-webhook schema-drift-slack: ${{ secrets.SLACK_WEBHOOK_URL }} schema-drift-teams: ${{ secrets.TEAMS_WEBHOOK_URL }} # Optional: add a Team license key for persisted alert history license-key: ${{ secrets.SCHEMALENS_KEY }}

๐Ÿ”” Slack & Teams alerts

Instant notifications with risk score, breaking changes, and migration preview. Free.

๐Ÿ”— Shareable alert URLs

Every alert gets a public link like schemalens.tech/schema-drift-alert.html#... that anyone on your team can open.

๐Ÿ“Š Team dashboard

Free: local history from opened alert links. Team: persisted server-side history for 90 days.

Open Team Dashboard See Sample Alert Add Slack App

๐Ÿ” Schema Lockfile Verification

Pin your database schema to a deterministic SHA-256 fingerprint and fail the build when it drifts unexpectedly. Generate a schema.lock with the Schema Lockfile Generator, commit it, and the Action verifies the fingerprint on every run.

# Add to your workflow โ€” fails when schema.lock no longer matches - uses: aimadetools/race-kimi@v1.0.2 with: old-schema-path: ./schema/base.sql new-schema-path: ./schema/current.sql dialect: postgres lockfile-path: ./schema.lock fail-on-lockfile-drift: true

๐ŸŽฏ Deterministic fingerprint

Canonicalizes CREATE TABLE / CREATE INDEX statements exactly like the lockfile generator, so the same schema always produces the same hash.

๐Ÿšฆ Fail or warn

Set fail-on-lockfile-drift: true to block merges, or false to surface the mismatch as a warning in the job summary.

๐Ÿ“ Job Summary + PR comment

Lockfile status appears in the Action job summary and PR comments automatically, with expected and actual hashes.

Generate schema.lock โ†’ Pre-commit Hook

Free vs Pro vs Team

The GitHub Action is free for every repo. Upgrade to Pro for personal power features, or Team when you need a shared workspace.

FeatureFreePro โ€” $39 lifetimeTeam โ€” $29/mo
Schema diff summaryโœ…โœ…โœ…
Breaking change detectionโœ…โœ…โœ…
Risk scoreโœ…โœ…โœ…
PR commentsโœ…โœ…โœ…
GitHub Check Runsโœ…โœ…โœ…
Rich Job Summaryโœ…โœ…โœ…
Smart Skip (no SQL changes)โœ…โœ…โœ…
Full migration SQL + rollbackโœ…โœ…โœ…
Markdown / JSON exportโœ…โœ…โœ…
Schema drift alerts (Slack/Teams)โœ…โœ…โœ…
Saved diff history & shareable linksโ€”โœ… Unlimitedโœ… Unlimited
80+ micro-toolsโ€”โœ…โœ…
Priority supportโ€”โœ…โœ…
Persisted alert historyโ€”โ€”โœ… 90 days
Shared workspace & admin controlsโ€”โ€”โœ…
Unlimited membersโ€”โ€”โœ…
Compare all plans โ†’ Start Team plan โ†’

Full configuration reference

# All available inputs with: old-schema-path: ./schema/old.sql # required new-schema-path: ./schema/new.sql # required dialect: postgres # optional: postgres | mysql | sqlite | mssql | oracle format: markdown # optional: json | markdown license-key: ${{ secrets.SCHEMALENS_KEY }} # optional โ€” enables drift alerts and higher rate limits fail-on-breaking: false # optional โ€” fail workflow if breaking changes found post-comment: false # optional โ€” post result as PR comment create-check-run: false # optional โ€” create a GitHub Check Run (needs checks:write) run-only-on-schema-change: false # optional โ€” skip if no .sql files changed in PR github-token: ${{ secrets.GITHUB_TOKEN }} # required if post-comment, create-check-run, or run-only-on-schema-change is true schema-drift-webhook: https://schemalens.tech/api/schema-drift-webhook # optional โ€” sends alert to hosted webhook (free; Team adds persistence) schema-drift-slack: ${{ secrets.SLACK_WEBHOOK_URL }} # optional โ€” Slack Incoming Webhook for alerts schema-drift-teams: ${{ secrets.TEAMS_WEBHOOK_URL }} # optional โ€” Microsoft Teams Webhook for alerts upload-report: false # optional โ€” upload self-contained HTML report artifact report-title: SchemaLens Schema Diff Report # optional โ€” artifact title lockfile-path: ./schema.lock # optional โ€” path to SchemaLens schema.lock for fingerprint verification fail-on-lockfile-drift: true # optional โ€” fail workflow when schema.lock drifts

Example: PostgreSQL project

# .github/workflows/schema.yml name: Schema Check on: pull_request: paths: - 'migrations/**' - 'schema.sql' jobs: diff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Get base schema run: | git show origin/${{ github.base_ref }}:schema.sql > schema-base.sql - uses: aimadetools/race-kimi@v1.0.2 with: old-schema-path: schema-base.sql new-schema-path: schema.sql dialect: postgres post-comment: true github-token: ${{ secrets.GITHUB_TOKEN }} fail-on-breaking: true

Start catching schema drift today

Free forever โ€” full migration SQL in every PR. Upgrade to Team for drift alerts and shared workspaces.

Try SchemaLens Free View Pro Pricing

๐Ÿข Need this for your team?

Engineering teams use SchemaLens Team to catch breaking schema changes in every PR, alert Slack/Teams, and build a shared risk dashboard. One prevented incident pays for a year.

โœ… Slack & Teams alerts on every breaking change
โœ… Shareable alert pages for Jira, Slack, on-call
โœ… Team dashboard with risk trends & CSV export
โœ… Unlimited members & admin controls
๐Ÿ‘๏ธ Preview Team Workspace Start Team Plan โ€” $29/mo Book a Setup Call

Team plan: $29/mo or $290/yr ยท Generate manager approval email โ†’ ยท ROI calculator โ†’