Free CI/CD integration — no signup required

Catch schema migration risks
before they merge.

Run SchemaLens in your CI/CD pipeline to automatically diff database schemas on every pull request. Get a markdown report of breaking changes, dropped columns, and missing indexes posted directly to your PR — before it reaches production.

No database connection required. Works with any SQL dump or migration file.

Add SchemaLens to your pipeline in minutes

Pick your platform, copy the template, and start catching breaking schema changes on every pull request.

⚡ CI/CD Setup Wizard 🚀 Add in 60 Seconds

Answer 4 questions. Auto-detect schema files from public GitHub repos. Get a ready-to-commit config file. Or browse copy-paste examples.

🐙

GitHub Actions

PR comments, Check Runs, smart skip

Add to Pipeline →
🦊

GitLab CI

MR comments, breaking gate, artifacts

Add to Pipeline →
🔧

Jenkins

Console reports, build descriptions

Add to Pipeline →

CircleCI

PR comments, artifacts, smart skip

Add to Pipeline →
🌐

Bitbucket

Pipelines PR comments & reports

Add to Pipeline →
🔷

Azure DevOps

PR comments, artifacts, path filters

Add to Pipeline →
💬

Slack

Slash commands & CI/CD alerts

Add to Slack

Why run schema diffs in CI/CD?

The cheapest place to fix a migration is before it ships.

🛡️

Block Breaking Changes

Automatically flag dropped tables, removed columns, NOT NULL without defaults, and type narrowing. Stop dangerous migrations at the PR gate.

📝

PR Comments with Diff Reports

SchemaLens posts a formatted markdown diff report as a PR comment. Reviewers see exactly what changed — tables, columns, constraints, indexes — without leaving GitHub.

Zero Dependencies

A single Node.js file with no npm install required. Drop ci/schemalens-diff.js into your repo and run it in any CI platform that supports Node 18+.

🗄️

5 SQL Dialects

PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, and Oracle. Pass --dialect=postgres (or mysql, sqlite, mssql, oracle) and get dialect-aware diff reports.

🔍

Semantic Diff — Not Text Diff

SchemaLens understands CREATE TABLE structure. It compares columns, types, defaults, constraints, indexes, triggers, and views — not just lines of text.

📤

JSON or Markdown Output

Export diff reports as Markdown for human review or JSON for programmatic pipeline gates. Fail the build only when breaking changes are detected.

🚨 Schema Drift Alerts for Teams

Get notified the moment schema drift is detected — and keep a shared history for your team.

🔔

Slack & Teams Notifications

The SchemaLens hosted webhook sends rich alerts to Slack or Microsoft Teams with risk scores, breaking changes, and full migration SQL.

🔗

Shareable Alert Pages

Every alert generates a public link like schemalens.tech/schema-drift-alert.html#.... Share it in Slack, paste it in Jira, or forward it to on-call.

📊

Team Dashboard

Open alert links to build a local team dashboard with risk trends, breaking change history, and CSV export. No server-side data storage required.

Open Team Dashboard See Sample Alert GitHub Action Setup

GitHub Actions Workflow

Add this workflow to .github/workflows/schema-diff.yml to diff schemas on every SQL-related PR.

🚀 Use the Official SchemaLens GitHub Action (Free) 👁️ Live Demo

name: Schema Diff

on:
  pull_request:
    paths:
      - 'db/schema.sql'
      - 'migrations/*.sql'
      - '**/*.sql'

jobs:
  schema-diff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Run SchemaLens Diff
        id: diff
        run: |
          git show origin/\${{ github.base_ref }}:db/schema.sql > /tmp/schema_base.sql 2>/dev/null || echo "-- No base schema" > /tmp/schema_base.sql
          node ci/schemalens-diff.js /tmp/schema_base.sql db/schema.sql --dialect=postgres --format=markdown --output=/tmp/report.md
          echo "report<> \$GITHUB_OUTPUT
          cat /tmp/report.md >> \$GITHUB_OUTPUT
          echo "EOF" >> \$GITHUB_OUTPUT

      - name: Comment PR
        uses: actions/github-script@v7
        with:
          script: |
            const report = `\${{ steps.diff.outputs.report }}`;
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: '## SchemaLens Diff Report\n\n' + report
            });

GitLab CI Template

Add this job to .gitlab-ci.yml to run schema diffs on merge requests.

🚀 View Full GitLab CI Guide with MR Comments
schema_diff:
  stage: test
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - db/schema.sql
        - migrations/*.sql
  image: node:20-alpine
  script:
    - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - git show origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME:db/schema.sql > /tmp/schema_base.sql 2>/dev/null || echo "-- No base schema" > /tmp/schema_base.sql
    - node ci/schemalens-diff.js /tmp/schema_base.sql db/schema.sql --dialect=postgres --format=markdown --output=schema_diff_report.md
  artifacts:
    paths:
      - schema_diff_report.md
    expire_in: 1 week

Bitbucket Pipelines

Copy bitbucket-pipelines.yml from this repo or use the template below.

🚀 View Full Bitbucket Pipelines Guide with PR Comments
image: node:20 pipelines: pull-requests: '**': - step: name: Schema Diff script: - git fetch origin $BITBUCKET_PR_DESTINATION_BRANCH - git show origin/$BITBUCKET_PR_DESTINATION_BRANCH:db/schema.sql > /tmp/schema_base.sql 2>/dev/null || echo "-- No base schema" > /tmp/schema_base.sql - node ci/schemalens-diff.js /tmp/schema_base.sql db/schema.sql --dialect=postgres --format=markdown --output=schema_diff_report.md artifacts: - schema_diff_report.md

Jenkins

Add a schema diff stage to your Jenkinsfile. Works with multibranch pipelines and freestyle jobs.

🚀 View Full Jenkins Guide with Build Descriptions
// Jenkinsfile
pipeline {
  agent any
  environment {
    SCHEMA_PATH = 'db/schema.sql'
    DIALECT = 'postgres'
    FAIL_ON_BREAKING = 'true'
    SKIP_NO_SQL_CHANGE = 'true'
  }
  stages {
    stage('Schema Diff') {
      steps {
        sh 'curl -sL https://schemalens.tech/ci/jenkins-diff.sh | bash'
      }
    }
  }
  post {
    always {
      archiveArtifacts artifacts: 'schema_diff_report.md'
    }
  }
}

CircleCI

Add a schema diff job to your CircleCI workflow. Works with any GitHub-connected project.

🚀 View Full CircleCI Guide with PR Comments
# .circleci/config.yml
version: 2.1
jobs:
  schema-diff:
    docker:
      - image: cimg/node:20.0
    steps:
      - checkout
      - run:
          name: Schema Diff
          command: curl -sL https://schemalens.tech/ci/circleci-diff.sh | bash
      - store_artifacts:
          path: schema_diff_report.md

Azure DevOps Pipelines

Add this job to azure-pipelines.yml to diff schemas on every SQL-related pull request.

🚀 View Full Azure DevOps Guide with PR Comments
trigger:
  branches:
    include:
      - main

pr:
  paths:
    include:
      - '**/*.sql'

pool:
  vmImage: ubuntu-latest

steps:
  - checkout: self
    fetchDepth: 0

  - task: NodeTool@0
    inputs:
      versionSpec: "20.x"

  - script: |
      git fetch origin $(System.PullRequest.TargetBranch)
      git show origin/$(System.PullRequest.TargetBranch):db/schema.sql > /tmp/schema_base.sql 2>/dev/null || echo "-- No base schema" > /tmp/schema_base.sql
      node ci/schemalens-diff.js /tmp/schema_base.sql db/schema.sql --dialect=postgres --format=markdown --output=/tmp/report.md
      cat /tmp/report.md
    displayName: 'SchemaLens Schema Diff'
    condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

  - task: PublishBuildArtifacts@1
    inputs:
      PathToPublish: '/tmp/report.md'
      ArtifactName: 'schema-diff-report'
    displayName: 'Publish diff report'

Standalone CLI

Use the same diff engine locally or in any CI platform.

# Download the CLI
curl -OL https://schemalens.tech/ci/schemalens-diff.js

# Basic usage
node ci/schemalens-diff.js old_schema.sql new_schema.sql

# With options
node ci/schemalens-diff.js old_schema.sql new_schema.sql \
  --dialect=postgres \
  --format=markdown \
  --output=diff_report.md

# JSON output for programmatic gates
node ci/schemalens-diff.js old_schema.sql new_schema.sql \
  --dialect=mysql \
  --format=json \
  --output=diff.json

Download schemalens-diff.js · View CI README

Related guides

Local

Pre-commit Hook Generator

Block breaking schema changes before they leave a developer's machine. Works with plain git hooks or the pre-commit framework.

Drift Detection

Schema Lockfile Generator

Pin your schema to a deterministic SHA-256 fingerprint. Generate a schema.lock file and CI verification script to catch unexpected drift.

Review

PR Comment Generator

Generate a polished GitHub PR comment from any schema diff. Includes risk score, migration SQL, rollback, and reviewer checklist.

Impact

Impact Report Generator

Turn any schema diff into a manager-ready impact report. Operational risk, application impact, downtime exposure, and recommended actions.

Team plan: CI/CD safety for the whole engineering org

The free integration catches breaking changes. The Team plan adds alerts, dashboards, and shared history so nothing slips through.

🔔 Slack & Teams alerts on every breaking change
🔗 Shareable alert pages for Jira / on-call
📊 Team dashboard with risk trends & CSV export
👥 Unlimited members & admin controls

$29/mo or $290/yr · one prevented incident pays for a year

👁️ Preview Team Workspace Start Team Plan — $29/mo Calculate ROI

Free forever for open source. No credit card required to start. Generate manager approval email →

Schema governance for platform engineering

Running CI/CD at scale? Give your platform team a shared schema control plane with breaking-change gates, lockfile verification, and drift alerts.

Platform Engineering Guide →

Protect data pipelines from breaking schema changes

Data engineering teams use SchemaLens in CI/CD to catch source schema changes before dbt models, ETL jobs, and warehouse loads fail.

Data Engineering Guide →

Add schema review to your pipeline today.

Copy the workflow template, drop in the CLI script, and start catching migration risks before they hit production. Free forever for open source and small teams.

Add GitHub Action → Try SchemaLens Free

No signup required. No data leaves your browser.