FIX: add port information when backuping/restoring

This commit is contained in:
Régis Hanol
2014-07-30 17:20:25 +02:00
parent 78e33f1931
commit 5f620c5b98
3 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,7 @@ module BackupRestore
SQL
end
DatabaseConfiguration = Struct.new(:host, :username, :password, :database)
DatabaseConfiguration = Struct.new(:host, :port, :username, :password, :database)
def self.database_configuration
config = Rails.env.production? ? ActiveRecord::Base.connection_pool.spec.config : Rails.configuration.database_configuration[Rails.env]
@ -107,6 +107,7 @@ module BackupRestore
DatabaseConfiguration.new(
config["host"],
config["port"],
config["username"] || ENV["USER"] || "postgres",
config["password"],
config["database"]