Skip to content

Commit

Permalink
Apply database migration on backup restore
Browse files Browse the repository at this point in the history
Backups restored to a newer version of SecureDrop may introduce breakage
if a migration has occurred. dpkg-reconfigure will call the postinst
which will in turn apply all necessary alembic migrations to the
database.
  • Loading branch information
emkll committed Aug 24, 2018
1 parent f922012 commit 0f2ce05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install_files/ansible-base/roles/restore/files/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def main():
# If the process exits with a non-zero return code, raises an exception.
subprocess.check_call(['service', 'apache2', 'restart'])
subprocess.check_call(['service', 'tor', 'reload'])
# Apply database migrations (if backed-up version < version to restore)
subprocess.check_call(['dpkg-reconfigure', 'securedrop-app-code'])


if __name__ == "__main__":
Expand Down

0 comments on commit 0f2ce05

Please sign in to comment.