diff --git a/scripts/upgrade b/scripts/upgrade index 4e433ac..06f6d6b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,22 @@ db_name=$(ynh_app_setting_get $app db_name) with_carddav=$(ynh_app_setting_get $app with_carddav) with_enigma=$(ynh_app_setting_get $app with_enigma) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= + +# If db_name doesn't exist, create it +if [ -z $db_name ]; then + db_name=$(ynh_sanitize_dbid $app) + ynh_app_setting_set $app db_name $db_name +fi + +# If final_path doesn't exist, create it +if [ -z $final_path ]; then + final_path=/var/www/$app + ynh_app_setting_set $app final_path $final_path +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================