Ran into a bunch of db issues when deploying staging... fun!
Name conflict between 2 migrations in accounting:
0041_update_privileges_locations.py
0041_remove_like_indexes.py
Since these were applied out of name order, South complained.
I resolved this by running ./manage.py migrate --merge accounting
Then, following the "Team Workflow" section, here: http://south.readthedocs.org/en/latest/tutorial/part5.html, I added this commit: https://github.com/dimagi/commcare-hq/commit/f86876aa14c7a869420d265c418d6a3917939178 I don't think the last part was necessary, but I did it anyway.
django.db.utils.ProgrammingError: relation "sofabed_caseactiondata_domain" already exists
Seems like the indices defined in 0011_auto__add_indexes_for_denorm_columns.py
already existed.
I resolved it by:
./manage.py migrate --fake sofabed 0011
./manage.py migrate sofabed 0010
./manage.py migrate sofabed 0011
Again, the last 2 steps were probably unnessary, but I wasn't sure if the other indices in that migration had been created on staging or not.