1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moncycle_ynh.git synced 2024-09-03 19:46:16 +02:00
This commit is contained in:
Limezy 2024-02-20 00:36:47 +07:00
parent c2826934fe
commit cffa3983fb
2 changed files with 17 additions and 1 deletions

6
conf/migrate_9.0.3.sql Normal file
View file

@ -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`;

View file

@ -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_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_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_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 else
if ynh_compare_current_package_version --comparison le --version 7.0~ynh6 if ynh_compare_current_package_version --comparison le --version 7.0~ynh6
then then
ynh_script_progression --message="7.0.6 to 8.0 database migration required, migrating" 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_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_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 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
fi fi
ynh_script_progression --message="You shouldn't see this" ynh_script_progression --message="You shouldn't see this"