Squashing Migrations¶
Squashing consolidates multiple migrations into a smaller set after a stable release boundary.
Command¶
dbwarden squash --database primary
Use squashing only when:
- no pending migrations remain
- your team agrees on a stable checkpoint
- rollback strategy remains clear
When to squash¶
After multiple versioned migrations that have been stable through several releases, you may want to consolidate them to reduce file count and simplify rollback.
Workflow recommendation¶
- Confirm all migrations are applied and stable
- Run squash and review new consolidated file
- Test that rollback still works correctly
- Keep the new file, retire the old ones in version control
Navigation¶
- Previous: Checksum Integrity
- Next: CI/CD Patterns