2đź‘Ť
Generally, you would do a makemigrations on your development branch, and you would move the code (in this case, migration files) up to higher branches (UAT, Staging, Master etc).
This way you would never need to run makemigrations on any other branch, but only the migrate command.
You can have as many migration files as you need, it doesn’t really affect performance and is highly optimised
You can always squash/merge your migrations if there are too many or if you wish to do so.
0đź‘Ť
Running makemigrations
will automatically create python files in the “migrations” folder of the app where you modified the model. These files must be versionned in git because they cannot be dissociated from your modifications of the model.
Then, when you will merge your branch, both the modification in the model and the corresponding migration will be in the git tree. So the next call to migrate
will synchronize the DB with the current state described by your models.
- [Answered ]-Understanding where to put the IPN reciever function in django-paypal
- [Answered ]-How do I re-create databases after they were deleted?
- [Answered ]-Django – place differently every second item in for loop
- [Answered ]-Unable to connect to WSGI daemon process mod_wsgi in Centos7 with Cpanel/WHM
- [Answered ]-Cassandra: occasional permission errors