I have an app on production. It has 251 migrations that take too much time when I run the tests, it is making development really slow. I need to do something about this and I'd like an advice. Is it recommendable to squash the 251 migrations? what if I erase then and then just fake initial? of course, I can't lose or change the database, it is on production. Thanks a lot for your help.
You can try to squash them, but you will probably run into the CircularDependencyError mentioned here: https://docs.djangoproject.com/en/1.11/topics/migrations/#squashing-migrations
Another option is to (make sure your database is backed up) remove all migration files, remove the data in the migrations table, make migrations again, migrate --with --fake-initial and hope everything still works -- obviously, try this in a development environment first, followed by a staging instance identical to your production server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With