1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

Properly rename the database during v1->v2 transition

This commit is contained in:
Alexandre Aubin 2023-12-27 21:35:18 +01:00
parent e142f23125
commit a27a5347bf

View file

@ -60,6 +60,15 @@ ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped"
# In the past, the db was called peertube_peertube >_>
if [[ "${db_name:-}" == "peertube_peertube" ]]
then
ynh_print_info --message="Renaming database..."
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
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================