Remove/recreate database via rake before restoring database

- --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
pull/1/head
Liam Morley 4 years ago
parent 915a4c1aaf
commit d2443a10d3

@ -12,5 +12,6 @@ heroku pg:backups:download
* Select branch to deploy(main) * Select branch to deploy(main)
* Verify in the activity log that Heroku builds the deployment * Verify in the activity log that Heroku builds the deployment
* Verify that the site contains the new features * Verify that the site contains the new features
* Run any one_off scripts that have been introduced for this release, as necessary
* Run the db:seed script * Run the db:seed script
* Verify that the data represented on the different tabs matches what is expected. The items listed in the measure key should be represented on the site. * Verify that the data represented on the different tabs matches what is expected. The items listed in the measure key should be represented on the site.

@ -9,10 +9,11 @@ TIMESTAMP=$(date +%s)
DUMP_FILENAME=$APP.$TIMESTAMP.dump DUMP_FILENAME=$APP.$TIMESTAMP.dump
## Uncomment this if you want the latest data ## Uncomment this if you want the latest data
# heroku pg:backups:capture #heroku pg:backups:capture --app=mciea-$APP
heroku pg:backups:download --app=mciea-$APP --output=$DUMP_FILENAME heroku pg:backups:download --app=mciea-$APP --output=$DUMP_FILENAME
pg_restore --clean --no-acl --no-owner --dbname=mciea_development $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 bundle exec rails db:environment:set RAILS_ENV=development

Loading…
Cancel
Save