diff --git a/manifest.json b/manifest.json index b8c9460..025d2c6 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "requirements": { "yunohost": ">= 3.6.0" }, - "version": "0.16.0~ynh1", + "version": "0.16.0~ynh2", "multi_instance": true, "services": [ "nginx" diff --git a/scripts/upgrade b/scripts/upgrade index 78de529..71ce6c6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,12 +48,6 @@ if [ -z "$salt" ]; then ynh_app_setting_set "$app" salt "$salt" fi -if [ -z "$db_pwd" ]; then - ynh_psql_test_if_first_run - ynh_psql_setup_db "$db_user" "$db_name" - db_pwd=$(ynh_app_setting_get "$app" psqlpwd) -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -83,6 +77,14 @@ path_url=$(ynh_normalize_url_path "$path_url") ynh_install_app_dependencies $pkg_dependencies + +# Now that postgresql is installed, check the db exists and the user is set up +if [ -z "$db_pwd" ]; then + ynh_psql_test_if_first_run + ynh_psql_setup_db "$db_user" "$db_name" + db_pwd=$(ynh_app_setting_get "$app" psqlpwd) +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================