Hi all,
The way I've always worked, developers run `makemigrations` locally, and commit migration files to the repo.
However, a suggestion has recently come my way that a better strategy is to only commit model changes to the repo (leaving the migrations directory gitignored), and then run `makemigrations` in whatever environment the app needs to run, whether that's another developer's laptop, or in production. The putative benefit is that this avoids the possibility of migration conflicts, and always guarantees a clean migration from the state of a database schema to the state of the Django models.
Googling around, this opinion seems to be moderately widespread, although the official docs, and the *majority* of commenters seem to agree that committing migration files is the right way.
I think I agree, but I can't quite put my finger on decisive arguments against the idea of not committing migration files. I feel like I am missing something.
What are some reasons we should go the route of committing migration files?
Thanks,
Tom