CAPYSQUASH

---

Title: Introducing CAPYSQUASH - Automatic Migration Cleanup. Description: Why we built a tool to squash your Postgres migrations safely and automatically. Date: 2025-01-15. Category: ANNOUNCEMENT. Author: CAPYSQUASH team.

ANNOUNCEMENT

INTRODUCING CAPYSQUASH: AUTOMATIC MIGRATION CLEANUP

TL;DR: We built a tool that automatically consolidates your Postgres migration files while guaranteeing schema safety through Docker-based validation.

THE PROBLEM WE'RE SOLVING

If you've ever worked on a fast-moving project using Supabase, Neon, or any Postgres-based platform, you know the pain:

287 migration files. All sitting in your repo.

Every schema change creates a new file:

  • 20250101120000_add_users_table.sql
  • 20250101120100_add_email_column.sql
  • 20250101120200_add_email_index.sql
  • ... (284 more files)

THE CONSEQUENCES

CI/CD pipelines slow to a crawl - running 287 migrations takes time Merge conflicts everywhere - multiple devs touching migration folders Repository bloat - git clone takes forever Impossible to debug - which file changed the users table again? Team frustration - "do we really need 50 files to add 5 columns?"

WHY EXISTING SOLUTIONS DON'T WORK

"Just Manually Consolidate Them"

Sure, but:

  • Takes hours of developer time
  • Error-prone and dangerous
  • How do you know you didn't break something?
  • Nobody wants to do this regularly

"Reset Migrations on Each Release"

Doesn't work when:

  • You have a production database
  • Multiple teams are deploying
  • You need migration history for debugging

"Just Live With It"

This is what most teams do. But:

  • Your CI/CD gets slower each week
  • Onboarding new devs becomes harder
  • The mess compounds over time

INTRODUCING CAPYSQUASH

A BETTER WAY

CAPYSQUASH automatically consolidates your migrations while guaranteeing zero schema drift through Docker-based validation.

BEFORE

Migrations

├── 001_users.sql

├── 002_add_email.sql

├── 003_add_name.sql

├── 004_add_index.sql

├── ... (283 more)

  • 287 files, 15 MB

  • AFTER

Migrations

  • ├── 001_initial_schema.sql

  • ├── 002_user_features.sql

  • ├── ... (10 more)

  • 12 files, 600 KB

  • ☑ Same exact database schema. Just cleaner.

HOW IT WORKS

The magic is in the Docker-based validation:

1

  • ANALYZE

  • Scan your migrations and identify consolidation opportunities

2

  • VALIDATE ORIGINAL

  • Spin up a Postgres container, apply all original migrations, dump the schema

3

  • CONSOLIDATE

  • Create new, consolidated migration files based on smart rules

4

  • VALIDATE SQUASHED

  • Apply squashed migrations to a fresh container, dump the schema

  • 5

  • COMPARE

  • Byte-for-byte comparison of schema dumps. If they match: ☑ If not: ☒ abort

The guarantee: If CAPYSQUASH completes successfully, your database schema is mathematically identical to what you had before.

REAL-WORLD RESULTS

CASE STUDY: ACME CORP

287→12 FILE REDUCTION

  • 8min→45s

  • CI/CD SPEED

  • 10min

  • TOTAL TIME

  • "We ran pgsquash on Friday afternoon. By Monday morning, our CI/CD was 10x faster and merge conflicts dropped to zero. Game changer."

  • Sarah, Lead Engineer

SAFETY FIRST

We know you're thinking: "This sounds dangerous.".

We thought so too. That's why we built multiple safety levels:

CONSERVATIVE For production. Only combines identical operations. Zero risk.

STANDARD Default. Combines compatible operations. Docker validated.

  • AGGRESSIVE
  • Maximum cleanup. Removes redundancy. Still validated.

Every single squash is validated through Docker. No exceptions.

GET STARTED IN 2 MINUTES


# Install

curl -sSL <https://get.CAPYSQUASH.dev> | sh

# Analyze

pgsquash analyze

# Squash

pgsquash squash --safety=standard

# Done!

    </div>

    ## CAPYSQUASH PLATFORM: WEB UI & AUTOMATION

    The pgsquash-engine CLI is just the beginning. **CAPYSQUASH Platform** adds:

    - 🌐 Beautiful web dashboard
    - 🤖 Automatic GitHub PR analysis
    - 📊 Project history and analytics
    - Team collaboration features
    - Zero configuration required

    **Try it now**: [https://capysquash.dev/sign-up](https://capysquash.dev/sign-up)

    ## OPEN SOURCE & FREE

    The **pgsquash-engine** CLI is **MIT licensed** and **completely free**.

    Why? Because we believe every developer deserves clean migrations without vendor lock-in. The CAPYSQUASH platform builds on this foundation with team features and automation.

    <Cards>
    <Card
    title="View on GitHub"
    description="Star the repo, read the code, contribute"
    href="https://github.com/CAPYSQUASH/pgsquash-engine"
    />
    <Card
    title="Read the Docs"
    description="Complete guides for Supabase, Neon, and more"
    href="/docs"
    />
    <Card
    title="Join the Community"
    description="Discord, discussions, and support"
    href="https://discord.gg/pgsquash"
    />
    </Cards>

    ## WHAT'S NEXT?

    We're just getting started. Available now and coming soon:

    - ☑ pgsquash-engine CLI (shipped!)
    - ☑ CAPYSQUASH Platform (live!)
    - ☑ GitHub App integration (live!)
    - � GitLab integration
    - 🚧 Advanced AI analysis
    - � Custom consolidation rules

    **Follow along:** [@CAPYSQUASH on Twitter](https://twitter.com/capysquash)

    ## TRY IT TODAY

    Clean up your migrations in under 10 minutes:

    <div className="brutalist-card-lg section-accent-success p-8 my-8 text-center">
    <h3 className="text-3xl font-black uppercase mb-6">READY TO SHIP CLEAN?</h3>
    <a href="/docs/getting-started/installation" className="brutalist-button-primary inline-block">
    GET STARTED NOW
    </a>
    </div>

    ---

    **Questions? Feedback?** Drop into our [GitHub Discussions](https://github.com/CAPYSQUASH/pgsquash-engine/discussions) or [contact us directly](/contact).

    **You ship fast, we clean the mess.** 🦫

On this page