From 6bc5241434428245845be8dbc4940c60dfe54a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 11 Nov 2023 14:35:58 +0100 Subject: [PATCH] fix --- scripts/remove | 8 ++++++++ scripts/restore | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 38401ff..0d69e80 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,6 +25,14 @@ ynh_remove_nginx_config # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +if [ $database == "postgresql" ] +then + ynh_script_progression --message="Removing PostgreSQL database..." --weight=2 + ynh_psql_remove_db --db_user=$db_user --db_name=$db_name +else + ynh_script_progression --message="Removing MySQL database..." --weight=2 + ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +fi #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index b4f23d3..6d962ba 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,7 +32,8 @@ chown -R $app:www-data "$install_dir" if [ $database == "postgresql" ] then - ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name + #ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name + ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql else ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql fi