docbrown/lib/tasks/db.rake
rhymes e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00

32 lines
1.3 KiB
Ruby

# rubocop:disable Metrics/LineLength
# 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
# rubocop:enable Metrics/LineLength