From cffa3983fb8fe7510c81512a0ce8b1161cb59556 Mon Sep 17 00:00:00 2001 From: Limezy Date: Tue, 20 Feb 2024 00:36:47 +0700 Subject: [PATCH] Upgrade --- conf/migrate_9.0.3.sql | 6 ++++++ scripts/upgrade | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 conf/migrate_9.0.3.sql diff --git a/conf/migrate_9.0.3.sql b/conf/migrate_9.0.3.sql new file mode 100644 index 0000000..b5c0fb9 --- /dev/null +++ b/conf/migrate_9.0.3.sql @@ -0,0 +1,6 @@ +ALTER TABLE `compte` +ADD `timeline_asc` tinyint(1) unsigned NOT NULL DEFAULT '1' AFTER `nb_co_echoue`, +ADD `recherche` tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER `donateur`; + +ALTER TABLE `observation` +ADD `compteur` tinyint(1) unsigned NULL AFTER `jour_sommet`; \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 073a118..9a240fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,14 +48,24 @@ pushd "$install_dir" ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.5.sql ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql + ynh_add_config --template="../conf/migrate_9.0.3.sql" --destination="$install_dir/migrate_9.0.3.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_9.0.3.sql else if ynh_compare_current_package_version --comparison le --version 7.0~ynh6 then ynh_script_progression --message="7.0.6 to 8.0 database migration required, migrating" ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql + ynh_add_config --template="../conf/migrate_9.0.3.sql" --destination="$install_dir/migrate_9.0.3.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_9.0.3.sql else - ynh_script_progression --message="7.0.6 to 8.0 database migration not required since package > 7.0.6" + if ynh_compare_current_package_version --comparison le --version 9.0~ynh3 + then + ynh_add_config --template="../conf/migrate_9.0.3.sql" --destination="$install_dir/migrate_9.0.3.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_9.0.3.sql + else + ynh_script_progression --message="7.0.6 to 8.0 database migration not required since package > 7.0.6" + fi fi fi ynh_script_progression --message="You shouldn't see this"