1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moncycle_ynh.git synced 2024-09-03 19:46:16 +02:00

Update to 8.0

This commit is contained in:
Limezy 2024-01-22 23:35:41 +06:30
parent 70109b7ed1
commit 2fe1f8ca36
4 changed files with 43 additions and 19 deletions

15
conf/migrate_7.0.6.sql Normal file
View file

@ -0,0 +1,15 @@
ALTER TABLE `compte`
ADD `totp_etat` smallint(5) unsigned DEFAULT NULL;
ALTER TABLE `compte`
ADD `totp_secret` varchar(255) DEFAULT NULL;
CREATE TABLE `cle_valeur` (
`cle` varchar(255) NOT NULL,
`valeur` bigint(20) unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `cle_valeur` (`cle`, `valeur`) VALUES
('pub_visite_mensuel', 0),
('pub_visite_hebdo', 0),
('pub_visite_jour', 0);

View file

@ -5,7 +5,7 @@ name = "Moncycle"
description.en = "Menstrual cycle follow-up for natural family planning" description.en = "Menstrual cycle follow-up for natural family planning"
description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance" description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance"
version = "7.0~ynh6" version = "8.0~ynh1"
maintainers = ["Raoul de Limezy"] maintainers = ["Raoul de Limezy"]
@ -38,8 +38,8 @@ ram.runtime = "50M"
[resources] [resources]
[resources.sources.main] [resources.sources.main]
url = "https://github.com/jean-io/moncycle.app/archive/4ee55999138825fd2f309fa27a69bafe6f5a0c36.zip" url = "https://github.com/jean-io/moncycle.app/archive/a686e4f1769203ec66884a772c9d274ce3777274.zip"
sha256 = "94c3010d12f9650ea87aecde046ef0ba4102308b566de94868adc76c69c22ccf" sha256 = "60697bc442373b25c996eedb805c71c2b63a6cc7abdcef2e08f5f4257fecb005"
[resources.system_user] [resources.system_user]

View file

@ -44,12 +44,22 @@ pushd "$install_dir"
ynh_script_progression --message="Checking if a database migration is needed" ynh_script_progression --message="Checking if a database migration is needed"
if ynh_compare_current_package_version --comparison le --version 7.0~ynh5 if ynh_compare_current_package_version --comparison le --version 7.0~ynh5
then then
ynh_script_progression --message="Database migration required, migrating" ynh_script_progression --message="7.0.5 to 8.0 database migration required, migrating"
ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate.sql" ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate_7.0.5.sql"
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate.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_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql
else else
ynh_script_progression --message="Database migration not required" if ynh_compare_current_package_version --comparison eq --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
else
ynh_script_progression --message="7.0.6 to 8.0 database migration not required"
fi fi
fi
ynh_script_progression --message="Database migration not required"
popd popd

View file

@ -1,5 +1,5 @@
diff --git a/www_data/lib/mail.php b/www_data/lib/mail.php diff --git a/www_data/lib/mail.php b/www_data/lib/mail.php
index f153e3c..e56f1fd 100644 index 363aeb7..343e33b 100644
--- a/www_data/lib/mail.php --- a/www_data/lib/mail.php
+++ b/www_data/lib/mail.php +++ b/www_data/lib/mail.php
@@ -15,10 +15,10 @@ function mail_init(){ @@ -15,10 +15,10 @@ function mail_init(){
@ -14,4 +14,3 @@ index f153e3c..e56f1fd 100644
+ $mail->SMTPSecure = false; + $mail->SMTPSecure = false;
$mail->Port = SMTP_PORT; $mail->Port = SMTP_PORT;
$mail->CharSet = 'UTF-8'; $mail->CharSet = 'UTF-8';