BUGFIX: restore wasn't working when not using multisite in production

This commit is contained in:
Régis Hanol
2014-02-20 18:42:17 +01:00
parent b696c96a19
commit 1f90f3044f
4 changed files with 21 additions and 30 deletions

View File

@ -203,15 +203,16 @@ module Import
db_conf = BackupRestore.database_configuration
password_argument = "PGPASSWORD=#{db_conf.password}" if db_conf.password.present?
host_argument = "--host=#{db_conf.host}" if db_conf.host.present?
host_argument = "--host=#{db_conf.host}" if db_conf.host.present?
username_argument = "--username=#{db_conf.username}" if db_conf.username.present?
[ password_argument, # pass the password to psql
[ password_argument, # pass the password to psql (if any)
"psql", # the psql command
"--dbname='#{db_conf.database}'", # connect to database *dbname*
"--file='#{@dump_filename}'", # read the dump
"--single-transaction", # all or nothing (also runs COPY commands faster)
host_argument, # the hostname to connect to
"--username=#{db_conf.username}" # the username to connect as
host_argument, # the hostname to connect to (if any)
username_argument # the username to connect as (if any)
].join(" ")
end