Problem
south and team workflow appears when two people create a migration without synchronizing with each other.
Imagine we have some repo. Faces A and B clone it, then change some model, create a migration, and then push it all back. We will have 2 migrations with the same number in the repo.
The South will complain if you try to make a migration with such a story.
Inconsistent migration history The following options are available:
As stated in the southern docs at http://south.readthedocs.org/en/latest/tutorial/part5.html , you can try using the --merge option, and the south will try to combine the migrations. It will not work if conflicting migrations change the same model (s).
./manage.py schemamigration --auto --merge appname
So, the basic rule for the team: at one time, only one developer could change one model. If someone started changing the model, no one should touch it until they have the migration files.
Rules for a team workflow with south and multiple git branches:
- Before making changes to double-checking the model, if someone is already making changes there
- Notify other members of your changes as soon as possible.
- Sync migration directories as soon as possible
Also from the southern docs: when you pull in some changes to the elses model complete with their own migration, you need to make a new empty migration that has changes from both development branches frozen in (if you used mercurial, this is equivalent to merging) . To do this, simply run:
./manage.py schemamigration --empty appname merge_models
merge_models there is only a new migration name
Group workflow rules with south and single git branch:
If all members of your team make one separation, the best strategy is to first make model changes, make migration, and direct it as soon as possible. Then work on another code.
These articles may also be of interest to you:
http://andrewingram.net/2012/dec/common-pitfalls-django-south/ http://anthony-tresontani.imtqy.com/Django/2013/03/15/south-workflow/