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

fix potential bug in variable names

This commit is contained in:
Salamandar 2024-05-27 14:54:16 +02:00
parent 4130f8af25
commit 7727e250c3

View file

@ -50,7 +50,7 @@ if ynh_compare_current_package_version --comparison lt --version "4.2.8~ynh2"; t
ynh_app_setting_set --app="$app" --key="db_name" --value="$db_name"
# Remove the newly created db by resources, and rename legacy db
ynh_psql_execute_as_root --sql="DROP DATABASE IF EXISTS ${app};"
ynh_psql_execute_as_root --sql="DROP DATABASE IF EXISTS $db_name;"
ynh_psql_execute_as_root --sql="ALTER DATABASE ${app}_production RENAME TO $db_name;"
fi
# Same with user
@ -58,8 +58,8 @@ if ynh_compare_current_package_version --comparison lt --version "4.2.8~ynh2"; t
db_user="$db_name"
ynh_app_setting_set --app="$app" --key="db_user" --value="$db_user"
ynh_psql_execute_as_root --sql="DROP USER IF EXISTS ${app};"
ynh_psql_execute_as_root --sql="ALTER USER ${app}_production RENAME $db_name;"
ynh_psql_execute_as_root --sql="DROP USER IF EXISTS $db_user;"
ynh_psql_execute_as_root --sql="ALTER USER ${app}_production RENAME $db_user;"
fi
fi