1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodebb_ynh.git synced 2024-09-03 19:46:29 +02:00
This commit is contained in:
ericgaspar 2021-03-25 22:19:07 +01:00
parent 2050f3657d
commit afce2bb03a
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 6 additions and 14 deletions

View file

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

View file

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

View file

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