nixos/onlyoffice: fix database upgrades

This commit is contained in:
Sandro Jäckel 2022-09-25 01:34:37 +02:00
parent 96de24efba
commit 0a564318e8
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -252,7 +252,10 @@ in
.rabbitmq.url = "${cfg.rabbitmqUrl}"
' /run/onlyoffice/config/default.json | sponge /run/onlyoffice/config/default.json
if ! psql -d onlyoffice -c "SELECT 'task_result'::regclass;" >/dev/null; then
if psql -d onlyoffice -c "SELECT 'task_result'::regclass;" >/dev/null; then
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/removetbl.sql
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
else
psql -f ${cfg.package}/var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
fi
'';