From 5bb955dcb71bab84d4fa489cda2c575bb5d6db57 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 8 Feb 2019 15:28:25 +0100 Subject: [PATCH] FIX: Allow restore when latest migration is a post_migration --- lib/backup_restore/restorer.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index 46fc47d760f..6c0ee649712 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -377,6 +377,14 @@ module BackupRestore def migrate_database log "Migrating the database..." + + if Discourse.skip_post_deployment_migrations? + ENV["SKIP_POST_DEPLOYMENT_MIGRATIONS"] = "0" + Rails.application.config.paths['db/migrate'] << Rails.root.join( + Discourse::DB_POST_MIGRATE_PATH + ).to_s + end + Discourse::Application.load_tasks ENV["VERSION"] = @current_version.to_s DB.exec("SET search_path = public, pg_catalog;")