Fix backups not working when feature_flags table does not exist
What does this MR do and why?
Previously this would fail if you attempted to restore the database:
RAILS_ENV=test bundle exec rake db:reset
RAILS_ENV=test bundle exec rake gitlab:backup:db:create
RAILS_ENV=test bundle exec rake gitlab:db:drop_tables
RAILS_ENV=test bundle exec rake gitlab:backup:db:restore
The last step would attempt to read backup_information.yml
and fail
because the file isn't generated in the gitlab:backup:db:create
task. We can disable the reading of that file since it's only needed
in the gitlab:backup:create
task.
In addition, the third step is optional. Since the feature_flags
table does not exist, the feature flag check that happened in the last
step would fail.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Stan Hu