Skip to content

Commit

Permalink
Add debug info to stage db reset script.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum committed Nov 7, 2017
1 parent 9a05cf0 commit 5eba798
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/reset-stage-db.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
set -x

LOCAL_DUMP="/app/scripts/prod_db_dump.sql"

Expand Down Expand Up @@ -29,6 +30,7 @@ echo
# work after the reset has been completed.
echo "Backing up existing permissions, roles, and required signoffs..."
mysqldump --skip-add-drop-table --no-create-info -h "$host" -u "$username" --password="$password" "$database" permissions user_roles product_req_signoffs permissions_req_signoffs > backup.sql
cat backup.sql

echo "Download prod dump..."
python scripts/get-prod-db-dump.py
Expand All @@ -40,4 +42,6 @@ echo "Upgrading database to the latest version..."
python scripts/manage-db.py -d $DBURI upgrade

echo "Re-adding permissions, roles, and required signoffs..."
cat backup.sql
cat backup.sql | mysql -h "$host" -u "$username" --password="$password" "$database"
mysqldump --skip-add-drop-table --no-create-info -h "$host" -u "$username" --password="$password" "$database" permissions user_roles product_req_signoffs permissions_req_signoffs

0 comments on commit 5eba798

Please sign in to comment.