Skip to content

Commit

Permalink
build: use env vars and default values for db maintenance script
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 25, 2024
1 parent ed17875 commit 2f5ac56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contrib/pg-upgrade/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ services:
gosu postgres pg_ctl start -D /var/lib/postgresql/data
# Upgrade PostGIS extension
PGPASSWORD=dtm \
psql --host=localhost --username=dtm dtm_db -c '
PGPASSWORD=${POSTGRES_PASSWORD:-dtm} \
psql --host=localhost --username=${POSTGRES_USER:-dtm} \
${POSTGRES_DB:-dtm_db} -c '
ALTER EXTENSION "postgis" UPDATE;
'
# Rebuild statistics use vacuum
PGPASSWORD=${POSTGRES_PASSWORD} \
PGPASSWORD=${POSTGRES_PASSWORD:-dtm} \
vacuumdb \
--host=localhost \
--username=${POSTGRES_USER} \
--username=${POSTGRES_USER:-dtm} \
--all \
--analyze-in-stages

0 comments on commit 2f5ac56

Please sign in to comment.