1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/immich_ynh.git synced 2024-09-03 20:36:24 +02:00

Fix myynh_update_psql_db

This commit is contained in:
Sylvain 2024-08-28 17:40:53 +02:00
parent 453e4319bd
commit 11652c9915

View file

@ -274,8 +274,8 @@ myynh_create_psql_db() {
myynh_update_psql_db() {
for db in postgres "$app"
do
test_collation_mismatch=$(ynh_exec_warn_less myynh_execute_psql_as_root --sql=";" --database="$db" | grep "collation version mismatch")
if [ -n "$test_collation_mismatch" ]
if ynh_exec_warn_less myynh_execute_psql_as_root --sql=";" --database="$db" \
| grep -q "collation version mismatch"
then
ynh_exec_warn_less myynh_execute_psql_as_root --sql="REINDEX DATABASE $db;" --database="$db"
myynh_execute_psql_as_root --sql="ALTER DATABASE $db REFRESH COLLATION VERSION;" --database="$db"