mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 16:43:57 +00:00
upgrade-postgresql: Get PostgreSQL version without manage.py shell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
d12601fbee
commit
927ea011d3
@@ -37,7 +37,12 @@ fi
|
|||||||
# Django actually stores its data in. We can only do that if the
|
# Django actually stores its data in. We can only do that if the
|
||||||
# database server is on the same host as the application server.
|
# database server is on the same host as the application server.
|
||||||
if [ -d /home/zulip/deployments/current ]; then
|
if [ -d /home/zulip/deployments/current ]; then
|
||||||
DATA_IS_IN=$(su zulip -c '/home/zulip/deployments/current/manage.py shell -c "from django.db import connection; print(int(connection.cursor().connection.server_version/10000))"')
|
DATA_IS_IN=$(
|
||||||
|
su -s /usr/bin/env -- zulip \
|
||||||
|
DJANGO_SETTINGS_MODULE=zproject.settings \
|
||||||
|
uv run --directory=/home/zulip/deployments/current --no-sync \
|
||||||
|
python -c 'from django.db import connection; print(connection.cursor().connection.server_version // 10000)'
|
||||||
|
)
|
||||||
|
|
||||||
if [ "$UPGRADE_FROM" != "$DATA_IS_IN" ]; then
|
if [ "$UPGRADE_FROM" != "$DATA_IS_IN" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user