Permalink
Browse files

No commit message

  • Loading branch information...
1 parent 07b108a commit 2c08023bf1952c399920abf600714e79d8ea6434 christocracy committed Jul 4, 2008
Showing with 3 additions and 4 deletions.
  1. +3 −4 tasks/geonames_tasks.rake
@@ -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}`

0 comments on commit 2c08023

Please sign in to comment.