diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresql index f8d91bf710..d75deb6d17 100755 --- a/scripts/setup/upgrade-postgresql +++ b/scripts/setup/upgrade-postgresql @@ -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.