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:
parent
60f85c680e
commit
463819cf10
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue