Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade-postgresql: Prevent PostgreSQL downgrades.

Alex Vandiver32e1384ca01f
diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresql
index fcc31bce173..35d4ee6c578 100755
--- a/scripts/setup/upgrade-postgresql
+++ b/scripts/setup/upgrade-postgresql
@@ -21,6 +21,11 @@ if [ "$UPGRADE_TO" = "$UPGRADE_FROM" ]; then
exit 1
fi
+if [[ "$UPGRADE_TO" -lt "$UPGRADE_FROM" ]]; then
+ echo "Refusing to downgrade PostgreSQL $UPGRADE_FROM to $UPGRADE_TO!"
+ exit 1
+fi
+
set -x
"$ZULIP_PATH"/scripts/lib/setup-apt-repo