diff --git a/scripts/upgrade b/scripts/upgrade index b2ab10c..10ec376 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,11 +12,13 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Migrate old (erroneous) database scheme (see: https://github.com/YunoHost-Apps/wallabag2_ynh/pull/125#issuecomment-1041426972) -ynh_script_progression --message="Migrating old (pre-2018) database scheme..." --weight=11 +if ynh_compare_current_package_version --comparison lt --version 2.4; then + # Migrate old (erroneous) database scheme (see: https://github.com/YunoHost-Apps/wallabag2_ynh/pull/125#issuecomment-1041426972) + ynh_script_progression --message="Migrating old (pre-2018) database scheme..." --weight=11 -ynh_exec_warn_less ynh_mysql_execute_file_as_root --database="$db_name" --file="../migrations/foreign-keys-removal.sql" -ynh_script_progression --message="Database migration done. Resuming normal upgrade process" --weight=11 + ynh_exec_warn_less ynh_mysql_execute_file_as_root --database="$db_name" --file="../migrations/foreign-keys-removal.sql" + ynh_script_progression --message="Database migration done. Resuming normal upgrade process" --weight=11 +fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE