FIX: Failed to restore backups from versions without translation overrides

Rails calls I18n.translate during initialization and by default translation overrides are used. Database migrations would fail if the system tried to migrate from an old version that didn't have the `translation_overrides` table with all its columns yet.

This makes restoring really old backups work again. Running `DISABLE_TRANSLATION_OVERRIDES=1 rake db:migrate` will allow you to upgrade such an old database as well.
This commit is contained in:
Gerhard Schlager
2020-03-12 18:43:27 +01:00
parent 3e34964c73
commit 8022e51179
4 changed files with 9 additions and 4 deletions

View File

@ -38,6 +38,7 @@ describe BackupRestore::DatabaseRestorer do
Discourse::Utils.expects(:execute_command).with do |env, command, options|
env["SKIP_POST_DEPLOYMENT_MIGRATIONS"] == "0" &&
env["SKIP_OPTIMIZE_ICONS"] == "1" &&
env["DISABLE_TRANSLATION_OVERRIDES"] == "1" &&
command == "rake db:migrate" &&
options[:chdir] == Rails.root
end.once