Skip to content

Commit

Permalink
build: enforce --encoding utf8 on pg_dump database backups
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 17, 2024
1 parent f53aa94 commit 7c56ef2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/dev/Production.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ This will map port 5432 on the remote machine to port 5430 on your local machine

docker exec -i -e PGPASSWORD=PASSWORD_HERE \
fmtm-${GIT_BRANCH}-fmtm-db-1 \
pg_dump --verbose --format c -U fmtm fmtm \
pg_dump --verbose --encoding utf8 --format c -U fmtm fmtm \
| gzip -9 > "$backup_filename"
```

Expand All @@ -124,7 +124,7 @@ This will map port 5432 on the remote machine to port 5430 on your local machine

docker exec -i -e PGPASSWORD=PASSWORD_HERE \
fmtm-${GIT_BRANCH}-central-db-1 \
pg_dump --verbose --format c -U odk odk | \
pg_dump --verbose --encoding utf8 --format c -U odk odk | \
gzip -9 > "$backup_filename"
```

Expand Down
4 changes: 2 additions & 2 deletions src/backend/backup-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ backup_db() {
--username "$db_user" "$db_name" -c "VACUUM ANALYZE;"

echo "Dumping current database to backup file: $db_backup_file"
PGPASSWORD="$db_password" pg_dump --verbose --format c \
--file "${db_backup_file}" \
PGPASSWORD="$db_password" pg_dump --verbose --encoding utf8 \
--format c --file "${db_backup_file}" \
--host "$db_host" --username "$db_user" "$db_name" \
>> /dev/null 2>&1

Expand Down
4 changes: 2 additions & 2 deletions src/backend/migrate-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ backup_db() {
--username "$FMTM_DB_USER" "$FMTM_DB_NAME" -c "VACUUM ANALYZE;"

pretty_echo "Dumping current database to backup file: $db_backup_file"
PGPASSWORD="$FMTM_DB_PASSWORD" pg_dump --verbose --format c \
--file "${db_backup_file}" \
PGPASSWORD="$FMTM_DB_PASSWORD" pg_dump --verbose --encoding utf8 \
--format c --file "${db_backup_file}" \
--host "$FMTM_DB_HOST" --username "$FMTM_DB_USER" "$FMTM_DB_NAME"

echo "gzipping file --> ${db_backup_file}.gz"
Expand Down

0 comments on commit 7c56ef2

Please sign in to comment.