[Django]-Is it good practice to add migrations files to the repository?

2👍

You should push them.
While they are all auto-generated, it may not make much sense, but eventually someone will create manual migration (eg. to add or correct some data, without changing models).
In that case, django is not aware of any changes, and won’t generate migration on next makemigrations.

Also before pushing, I would strongly recommend checking if the migration can be successfully reverted.

👤nenadp

1👍

Absolutely, all migration files should be committed. It’s vital to ensure all users are running from the same set of migrations otherwise weird bugs could occur.

Leave a comment