Django squashmigrations: cleaning up your migration history

Django squashmigrations: cleaning up your migration history

After a few months of development, it’s not unusual to end up with 30, 50, or even 100 migration files on a Django application. Every test run that starts from a clean database replays them all. Every deployment to a new environment does too. squashmigrations lets you merge several migrations into one, without losing compatibility with environments that have already applied earlier migrations. The command and what it generates The syntax takes a range of migrations: ...

May 7, 2026 · 5 min · Anthony

Newsletter

Get new articles delivered straight to your inbox.

No spam. Unsubscribe in one click.