prisma-migrate-squash

Installation
SKILL.md

Prisma Migrate Squash

Squashing migrations collapses your entire migration history into one clean init migration that represents the current schema state. The result is a single SQL file that can bootstrap a fresh database, while production databases skip it (already applied).

When to squash

  • Migration folder is cluttered after months of development
  • Onboarding new developers who don't need history
  • Preparing for a major version release
  • Dev database drift is causing migrate dev consistency errors

A common mistake to avoid

Do not use prisma migrate dev --name init to squash. That command creates a new incremental migration based on schema drift — it does not collapse existing migrations. Use prisma migrate diff --from-empty as described below.

Step-by-step process

Step 1: Inspect before you delete

Installs
1
First Seen
Mar 24, 2026