Reverting Database Changes

Sometimes a staging database gets changed by pull requests which are not finished yet. Those changes should be reverted and some of these changes may actually break the application. So here are a couple of scripts for testers to execute on the server.

Log into the staging server with ssh and run these:

  • This command will save the DB in its current state. It should be used when we know the DB is in a healthy state.

~/apps/openfoodnetwork/current/script/ci/save-staging-baseline.sh

  • This command will restore the DB to its previously saved state. It can be used after changing or eventually having corrupted the DB; it will revert those changes. Notice that running this may lead to the loss of test data.

~/apps/openfoodnetwork/current/script/ci/restore-staging-baseline.sh

  • Save baseline data when you have a good pull request that gets merged and you want to keep your test data.

Reference: See also the PR which introduced these changes.

Last updated

Was this helpful?