summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-27 12:27:30 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-27 12:27:30 +0000
commit0a963ee15a3c544fcf647ae94d348fe3369251c9 (patch)
tree72ce634f52758498a26eee9e618d0b297cd9f1be
parentb2cab1c52ad32166c49903d00f25c305aa225ddb (diff)
parent8fe10e642ad9b5d236d2b00cea475bdc519130c0 (diff)
downloadgitlab-ce-0a963ee15a3c544fcf647ae94d348fe3369251c9.tar.gz
Merge branch 'pg_force_restore' into 'master'
Pg Force Restore
-rw-r--r--lib/backup/database.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index ebb4f289c52..6552f45ff0b 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -29,6 +29,8 @@ module Backup
print "Restoring MySQL database #{config['database']} ... "
system('mysql', *mysql_args, config['database'], in: db_file_name)
when "postgresql" then
+ puts "Destructively rebuilding database schema for RAILS_ENV #{Rails.env}"
+ Rake::Task["db:schema:load"].invoke
print "Restoring PostgreSQL database #{config['database']} ... "
pg_env
system('psql', config['database'], '-f', db_file_name)