Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temp fix to apply migrations correctly to staging/prod DBs
This one is pretty obscure There are a couple of issues with third party plugin migrations we need to solve here: 1. https://github.com/aldryn/aldryn-video/blob/126580c04fc6c0c60d23361280d56bd5333f5c51/aldryn_video/migrations/0001_initial.py#L11-L12 depends on `__latest__` (which is essentially bug in most cases for this reason). Having already applied `aldryn_video 0001` now means we can't apply `cms 0016` the `temp_migration_settings` file allows us to temporarily un-register `aldryn_video` by running `python manage.py migrate cms 0016 --settings foundation.temp_migration_settings` without either breaking the site or failing on `django.db.migrations.exceptions.InconsistentMigrationHistory: Migration aldryn_video.0001_initial is applied before its dependency cms.0016_auto_20160608_1535 on database 'default'.` 2. Some other migration relies on `easy_thumbnails 0001` but doesn't declare it as a migration dependency, so we need to run `python manage.py migrate easy_thumbnails` to avoid throwing `django.db.utils.ProgrammingError: relation "easy_thumbnails_source" does not exist` 3. Once we've done those we can run `python manage.py migrate` to apply the remaining issues without error Once we've run this once on staging and once on production to migrate the existing DBs correctly, we can do another commit to revert this change and delete `temp_migration_settings` and set CMD back to `python manage.py migrate && python manage.py update_index && /usr/bin/supervisord` before the next deploy.
- Loading branch information