docbrown/lib/tasks/db.rake
Tim Lange 3494264404 Enabled rubocop/lint (#2130)
* WIP: Enabled rubocop/lint

* FIX: Fixed failing test

* FIX: Small change to return

* FIX: Changed indent
2019-03-21 10:53:44 -04:00

30 lines
1.2 KiB
Ruby

# namespace :db do
#
# desc "Copy production database to local"
#
# task :copy_production => :environment do
# puts "FIRING UP!"
# # Download latest dump
# system("echo hey")
# system("heroku pg:backups --remote heroku capture")
# system("curl -o latest.dump `heroku pg:backups --remote heroku public-url`")
#
#
# # get user and database name
# # config = Rails.configuration.database_configuration["development"]
# # database = config["database"]
# # user = config["username"]
# #
# # # import
# # system("pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{database} #{Rails.root}/tmp/latest.dump")
# end
#
# end
#
#
# heroku pg:backups --remote heroku capture
# curl -o latest.dump `heroku pg:backups --remote heroku public-url`
# rake db:reset
# pg_restore --verbose --no-acl --no-owner -t articles -t users -t podcasts -t podcast_episodes -t sponsors -t identities -t organizations -h localhost -d PracticalDeveloper_development latest.dump
# rake db:migrate
# pg_restore --verbose --clean --no-acl --no-owner -t articles -t users -t podcasts -t podcast_episodes -t sponsors -t identities -t organizations -h localhost -d PracticalDeveloper_development latest.dump