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 devconsistency 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.