Skip to content

Commit

Permalink
Consider that linked app might not have a database
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Feb 20, 2024
1 parent bb289da commit 1b2e509
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions providers/mittwald.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ auth_command:
db_pull_command:
command: |
set -e -o pipefail
DATABASE_ID=$(mw app get -ojson | jq -r '(.linkedDatabases[] | select(.purpose = "primary")).databaseId')
mw database mysql dump "${DATABASE_ID}" --gzip -o /var/www/html/.ddev/.downloads/db.sql.gz
database_id=$(mw app get -ojson | jq -r 'if has("linkedDatabases") then ((.linkedDatabases[] | select(.purpose == "primary")).databaseId) else empty end')
if [[ -n "${database_id:-}" ]] ; then
mw database mysql dump "${database_id}" --gzip -o /var/www/html/.ddev/.downloads/db.sql.gz
fi
files_import_command:
command: |
Expand Down

0 comments on commit 1b2e509

Please sign in to comment.