1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tooljet_ynh.git synced 2024-10-01 13:34:55 +02:00

Set user as superuser in postgresql temporarily

This commit is contained in:
Salamandar 2024-07-14 22:08:49 +02:00
parent b9be30b329
commit 448fe53909
2 changed files with 10 additions and 4 deletions

View file

@ -94,7 +94,10 @@ ynh_script_progression --message="Building ToolJet database..." --weight=1
pushd $install_dir
# Build the database once the configuration is set
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run db:migrate
# Need superuser because it uses a temporary database...
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name"
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run db:migrate
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name"
popd
#=================================================

View file

@ -101,7 +101,10 @@ ynh_script_progression --message="Building ToolJet database..." --weight=1
pushd $install_dir
# Build the database once the configuration is set
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run db:migrate
# Need superuser because it uses a temporary database...
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name"
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run db:migrate
ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name"
popd
#=================================================