From cc5c4503069b8d863e4c39fe9bdcf6d9a7984187 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Sep 2021 20:10:18 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0e3113d..5ada0d1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,17 +33,6 @@ language=$(ynh_app_setting_get --app=$app --key=language) upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=3 - -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -61,6 +50,13 @@ ynh_abort_if_errors #================================================= # CHECK THE PATH #================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=3 + +# If db_name doesn't exist, create it +if [ -z "$db_name" ]; then + db_name=$(ynh_sanitize_dbid --db_name=$app) + ynh_app_setting_set --app=$app --key=db_name --value=$db_name +fi # If final_path doesn't exist, create it if [ -z "$final_path" ]; then