Skip to content

Instantly share code, notes, and snippets.

View dankmitchell's full-sized avatar
🎯
Focusing

Dan Mitchell dankmitchell

🎯
Focusing
View GitHub Profile
@dankmitchell
dankmitchell / db.rake
Created March 27, 2018 21:35 — forked from benbartling/db.rake
Rake Task - Restore Heroku Postgres to Local DB - Ruby on Rails
#CAPTURE NEW: rails db:restore_from_production\[capture\]
#DOWNLOAD LATEST: rails db:restore_from_production\[download\]
#RESTORE: rails db:restore_from_production
#[HEROKU_APP_NAME] = Name of your heroku app.
#[NUMBER_OF_CORES] = Number of concurrent jobs to run for pg_restore.
namespace :db do
desc 'Pull down the latest backup from Heroku and rebuild your local database with it.'
task :restore_from_production, [:process] => :environment do |task, args|