CAPYSQUASH
return (
← Back to Blog
ANNOUNCEMENT

Introducing CAPYSQUASH - Automatic Migration Cleanup

Why we built a tool to squash your Postgres migrations safely and automatically

by 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

<div className="border-4 border-foreground p-6 bg-background">
  <h4 className="font-black uppercase mb-3">AFTER</h4>
  <div className="brutalist-code text-xs">
migrations/
├── 001_initial_schema.sql
├── 002_user_features.sql
├── ... (10 more)
  </div>
  <p className="font-bold text-sm mt-3">12 files, 600 KB</p>
</div>

☑ 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!

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

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.

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

TRY IT TODAY

Clean up your migrations in under 10 minutes:

READY TO SHIP CLEAN?

GET STARTED NOW


Questions? Feedback? Drop into our GitHub Discussions or contact us directly.

You ship fast, we clean the mess. 🦫

On this page