mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 15:38:21 -07:00
- --clean doesn't seem to work when the structure in the database we're loading doesn't match the structure of the database we have locally
21 lines
552 B
Bash
Executable file
21 lines
552 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
set -eux
|
|
|
|
git rev-parse --show-toplevel
|
|
|
|
APP=$1
|
|
TIMESTAMP=$(date +%s)
|
|
DUMP_FILENAME=$APP.$TIMESTAMP.dump
|
|
|
|
## Uncomment this if you want the latest data
|
|
#heroku pg:backups:capture --app=mciea-$APP
|
|
heroku pg:backups:download --app=mciea-$APP --output=$DUMP_FILENAME
|
|
|
|
bundle exec rake db:drop db:create
|
|
pg_restore --no-acl --no-owner --dbname=mciea_development $DUMP_FILENAME
|
|
|
|
bundle exec rails db:environment:set RAILS_ENV=development
|
|
|
|
# clean up after ourselves; comment this out if you want to hold on to dump file
|
|
rm $DUMP_FILENAME
|