Skip to content

Instantly share code, notes, and snippets.

@proteusvacuum
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proteusvacuum/235ddf5b4da0ed8911aa to your computer and use it in GitHub Desktop.
Save proteusvacuum/235ddf5b4da0ed8911aa to your computer and use it in GitHub Desktop.
Staging woes jun 4 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment