From 2b9decd65bf5b644637282894ddbbca0c7c18e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 9 Mar 2024 14:00:03 +0100 Subject: [PATCH] Only migrating db when upgrading from <2.4.0 --- scripts/upgrade | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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