Prometheus
Prometheus

Reputation: 33625

How to optimize migrations in Django 1.8

I'm using Django 1.8 and have an app with over 100 files in the migration folder. Is there a way in Django without deleting the files to "compress" or "optimise" these migrations so I don't have so many of them?

Upvotes: 4

Views: 1839

Answers (1)

het.oosten
het.oosten

Reputation: 885

Have you read this part from the django docs?

Squashing migrations¶

You are encouraged to make migrations freely and not worry about how many you have; the migration code is optimized to deal with hundreds at a time without much slowdown. However, eventually you will want to move back from having several hundred migrations to just a few, and that’s where squashing comes in.

Source: https://docs.djangoproject.com/en/1.8/topics/migrations/

Upvotes: 11

Related Questions