Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-18 17:33:35 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-18 17:33:35 +0300
commitac571623d88314c89773ecdb484fc1c4ea92de1a (patch)
tree0cfea06c73e0f1a0217862f636b818fa1da1b3be /lib
parent8b05abe816b0c681ac218096b294311dd04fde8b (diff)
parentd7242054bafc49d66b0102f12706ac71a9e5d04c (diff)
Merge branch 'pg_dump_schema' into 'master'
Add pg_schema to backup config https://dev.gitlab.org/gitlab/gitlabhq/issues/2489 See merge request !1345
Diffstat (limited to 'lib')
-rw-r--r--lib/backup/database.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index ce75476a09b..959ac4b7868 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -25,8 +25,12 @@ module Backup
when "postgresql" then
$progress.print "Dumping PostgreSQL database #{config['database']} ... "
pg_env
- # Pass '--clean' to include 'DROP TABLE' statements in the DB dump.
- system('pg_dump', '--clean', config['database'], out: db_file_name)
+ pgsql_args = ["--clean"] # Pass '--clean' to include 'DROP TABLE' statements in the DB dump.
+ if Gitlab.config.backup.pg_schema
+ pgsql_args << "-n"
+ pgsql_args << Gitlab.config.backup.pg_schema
+ end
+ system('pg_dump', *pgsql_args, config['database'], out: db_file_name)
end
report_success(success)
abort 'Backup failed' unless success