Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No commit message

  • Loading branch information...
commit 2c08023bf1952c399920abf600714e79d8ea6434 1 parent 07b108a
christocracy authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 tasks/geonames_tasks.rake
7 tasks/geonames_tasks.rake
View
@@ -10,11 +10,10 @@ namespace :geonames do
puts " Dumping geonames tables to /db with pg_dump"
puts "*************************************************************************************"
- fprefix = "db/#{RAILS_ENV}_"
config = ActiveRecord::Base.configurations[RAILS_ENV]
["country", "country_region", "country_region_city"].each do |name|
- cmd = "/usr/bin/pg_dump -U postgres -t #{name} -a cca_backend_development --format=c > #{fprefix + name}.sql"
+ cmd = "/usr/bin/pg_dump -U postgres -t #{name} -a #{config['database']} --format=c > #{name}.sql"
# show cmd user before execing
puts ">#{cmd}"
puts `#{cmd}`
@@ -25,11 +24,11 @@ namespace :geonames do
puts "*************************************************************************************"
puts " Restoring geonames tables to from backup in /db "
puts "*************************************************************************************"
- fprefix = "db/#{RAILS_ENV}_"
+
config = ActiveRecord::Base.configurations[RAILS_ENV]
["country", "country_region", "country_region_city"].each do |name|
- cmd = "/usr/bin/pg_restore -U postgres -t #{name} -a -d cca_backend_development --format=c < #{fprefix + name}.sql"
+ cmd = "/usr/bin/pg_restore -U postgres -t #{name} -a -d #{config['database']} --format=c < #{name}.sql"
# show cmd user before execing
puts ">#{cmd}"
puts `#{cmd}`
Please sign in to comment.
Something went wrong with that request. Please try again.