diff options
| author | mo <mokha@cisco.com> | 2017-08-31 14:55:11 -0600 |
|---|---|---|
| committer | mo <mokha@cisco.com> | 2017-08-31 14:55:11 -0600 |
| commit | 29226203fe7cc1c5fddd49a5017e1719f2cf17ce (patch) | |
| tree | 8dda0d99d44f6668c20736b4a4afab18c6dd0cdb /lib/tasks/database.rake | |
| parent | 31b7af8b613c942af36b411de5b30d4f720d177d (diff) | |
upgrade
Diffstat (limited to 'lib/tasks/database.rake')
| -rw-r--r-- | lib/tasks/database.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake index 1e2e3e1e..a34bd7cc 100644 --- a/lib/tasks/database.rake +++ b/lib/tasks/database.rake @@ -2,7 +2,7 @@ namespace :db do task :restore do config = Rails.configuration.database_configuration destination_db = config[Rails.env]["database"] - host = config[Rails.env]["host"] + host = config[Rails.env].fetch("host", "localhost") newest_backup = Dir['db/backups/*.dump'].max_by { |file| File.mtime(file) } sh "PGPASSWORD=#{config[Rails.env]["password"]} pg_restore --verbose --clean --no-acl --no-owner -h #{host} -U #{config[Rails.env]["username"]} -d #{destination_db} #{newest_backup}" |
