upgrade-postgresql: Only upgrade to a supported version.

This commit is contained in:
Alex Vandiver 2023-06-12 22:58:59 +00:00 committed by Tim Abbott
parent f4b20337a7
commit 875502b2e1
1 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,8 @@ export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
UPGRADE_TO=${1:-15}
LATEST_SUPPORTED_VERSION=15
UPGRADE_TO=${1:-$LATEST_SUPPORTED_VERSION}
UPGRADE_FROM=$(crudini --get /etc/zulip/zulip.conf postgresql version)
ZULIP_PATH="$(dirname "$0")/../.."
@ -26,6 +27,12 @@ if [[ "$UPGRADE_TO" -lt "$UPGRADE_FROM" ]]; then
exit 1
fi
if [[ "$UPGRADE_TO" -gt "$LATEST_SUPPORTED_VERSION" ]]; then
echo "This version of Zulip does not support PostgreSQL $UPGRADE_TO."
echo "You may need to upgrade Zulip before you can upgrade to PostgreSQL $UPGRADE_TO."
exit 1
fi
# Verify that the version in /etc/zulip/zulip.conf is the version that
# Django actually stores its data in. We can only do that if the
# database server is on the same host as the application server.