-
Notifications
You must be signed in to change notification settings - Fork 1
Troubleshooting
This occurs when the settings file isn't loaded. One cause of this is that your DJANGO_SETTINGS_MODULE environment variable is already set to an incorrect value. Use unset DJANGO_SETTINGS_MODULE to allow manage.py to set its value.
Example
- Migrating forwards to 0012_auto__add_genericimage.
> assets:0011_auto__add_field_product_sku__del_field_productmedia_media_type__chg_fi
! Error found during real run of migration! Aborting.
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
! You *might* be able to recover with: ...
This almost certainly means that some of your migrations are out of order. This happens because migrations are numbered, but also have accompanying text, so git won't detect a merge conflict if there are duplicate numbered conflicts. For example
pinpoint/migrations
- ...
- 0010_auto__del_some_column.py
- 0010_auto__add_some_other_conflicting_thing.py
You may think that you can just re-order the migrations. Nope. Because we use RDS, migrations are left in a bad state, and something like this will occur after you do that:
! These migrations are in the database but not on disk:
<assets: 0010_auto__add_genericmedia>
! I'm not trusting myself; either fix this yourself by fiddling
! with the south_migrationhistory table, or pass --delete-ghost-migrations
! to South to have it delete ALL of these records (this may not be good).
In this case, you'll have no choice but to go into the south_migrationhistory table in the database, and:
- Rename your missing migration to the new one
- Figure out what the last successful migration was, and remove any migrations after that
This is a tricky process, so in general be aware of the migrations before deploying.