How to squash all migration files in to one in django?

Viewed 6322

I have 82 migration files in my django app. Some of them are related to removed models. I want to merge all these 82 migration files into one migration file.

How do I do without deleting the database?

1 Answers

The django documentation has a section devoted to this.

From the documentation page:

./manage.py squashmigrations myapp 0004

Where myapp is the name of your application, and 0004 is the migration to squash up to.

Related