[tooling] pin both dev and prod to same postgres version (12)
Changes
- this pins postres containers on both dev and prod to v12 (to avoid
breeaking file system inconsistencies when inadvertently updatiing
from one version to another via
docker-compose pull
or if building new system from scratch based on old data) - it also modifies docker-compose config to enagle
trust
auth method on all dbs (which is necessary in postgres v12, but was no on v11)
if you were using v11 and need a workaround, there are 2 options:
- (1) if you don't mind losing data: destroy your old db and build a new one
- (2) if you want to preserve data: run a psql dump from the old version and restore it to the new one
Destructive Workaround:
cd path/to/signalboost
make dev.down
docker volume rm signalboost_postgres_data
docker-compose -f docker-compose-dev.yml pull db
make _.setup
make dev.up
Non-Destructive Workaround:
cd path/to/signalboost
make dev.down
manually edit docker-compose: change postgres:12 to postgres:11
make dev.up
docker-compose -f docker-compose-dev.yml exec -T db pg_dump -U postgres signalboost_development > db_backup
make dev.down
docker volume rm signalboost_postgres_data
manually edit docker-compose: change postgres:11 to postgres:12
docker-compose -f docker-compose-dev.yml pull db
make _.setup
make dev.up
docker-compose -f docker-compose-dev.yml exec -T db psql -U postgres -d signalboost_development < db_backup
Edited by aguestuser