From 3cbda20ca1ed931755a29232fd7762f5581b2fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 26 Jun 2022 11:07:34 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b99caba..94edea0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,6 +91,11 @@ if [ -z "$db_name" ]; then ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi +if [ -z "$db_pwd" ]; then + db_pwd=$(ynh_string_random --length=24) + ynh_app_setting_set --app=$app --key=psqlpwd --value=$db_pwd +fi + # If final_path doesn't exist, create it if [ -z "$data_path" ]; then data_path="/home/yunohost.app/$app" @@ -180,8 +185,6 @@ if mysqlshow | grep -q "^| $db_name "; then ynh_script_progression --message="Creating a PostgreSQL database..." --weight=10 - #postgresql_db_pwd=$(ynh_string_random --length=24) - #ynh_app_setting_set --app=$app --key=postgresql_db_pwd --value=$postgresql_db_pwd ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd # Migrating from MySQL to PostgreSQL