Skip to content

Commit

Permalink
upgrade: Rename database to match packaging v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tagadda committed Aug 1, 2023
1 parent 099f221 commit eb86c0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=/var/log
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=/var/log/$app/$app-sidekiq.log --line_match="Stopped"
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=/var/log/$app/$app-streaming.log --line_match="Stopped"

# Rename the database to match packaging v2 defaults db_name (`$app_production` to `$app`)
if [[ $db_name = *'_production' ]]; then
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

#=================================================
# ADD SWAP IF NEEDED
#=================================================
Expand Down

0 comments on commit eb86c0e

Please sign in to comment.