1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

rename db

This commit is contained in:
Tagada 2023-06-02 15:23:19 +02:00
parent 60f85c680e
commit 463819cf10

View file

@ -55,6 +55,17 @@ if [[ -z "$redis_namespace" ]]; then
ynh_app_setting_set --app=$app --key=redis_namespace --value=$redis_namespace
fi
# Rename the database to match packaging v2 defaults db_name
if [[ $db_name = *'_production' ]]; then
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=systemd --line_match="Stopped"
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=systemd --line_match="Stopped"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=systemd --line_match="Stopped"
ynh_psql_execute_as_root --sql="ALTER DATABASE $db_name RENAME TO $app;"
db_name=$app
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi
#=================================================
# STOP SYSTEMD SERVICE
#=================================================