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:
parent
e142f23125
commit
a27a5347bf
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue