From afce2bb03ab6a0affd91a869487911564f20d6e2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Mar 2021 22:19:07 +0100 Subject: [PATCH] fix --- scripts/backup | 2 +- scripts/install | 6 +++--- scripts/remove | 12 ++---------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/backup b/scripts/backup index ca47243..9417960 100644 --- a/scripts/backup +++ b/scripts/backup @@ -68,7 +68,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Backing up the MySQL database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 196639e..aaa863b 100644 --- a/scripts/install +++ b/scripts/install @@ -70,12 +70,12 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --time --weight=1 +ynh_script_progression --message="Creating a PostgreSQL database..." --time --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +ynh_psql_test_if_first_run +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name #================================================= # CREATE DEDICATED USER diff --git a/scripts/remove b/scripts/remove index 2adad7c..777fda6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -46,18 +46,10 @@ ynh_remove_systemd_config #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." --time --weight=1 +ynh_script_progression --message="Removing the PostgreSQL database..." --time --weight=1 # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - - -#================================================= -# REMOVE THE MONGO DATABASE -#================================================= - -mongo --shell "$dbname" --eval 'db.dropUser("'${dbuser}'", {w: "majority", wtimeout: 5000})' <<< exit -mongo --shell "$dbname" --eval 'db.runCommand({dropDatabase: 1})' <<< exit +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES