mirror of
https://github.com/YunoHost-Apps/pleroma_ynh.git
synced 2024-09-03 20:15:59 +02:00
Fix pleroma database removal
This commit is contained in:
parent
34843fafdb
commit
78eda48122
2 changed files with 5 additions and 2 deletions
|
@ -148,7 +148,7 @@ ynh_app_setting_set "$app" db_pwd "$db_pwd"
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_psql_create_user "$app" "$db_pwd"
|
ynh_psql_create_user "$app" "$db_pwd"
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
|
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $db_name;"
|
||||||
ynh_psql_execute_as_root "\connect $db_name
|
ynh_psql_execute_as_root "\connect $db_name
|
||||||
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||||
ynh_psql_execute_as_root "\connect $db_name
|
ynh_psql_execute_as_root "\connect $db_name
|
||||||
|
|
|
@ -43,9 +43,12 @@ fi
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MYSQL DATABASE
|
# REMOVE THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_psql_execute_as_root "\connect $db_name
|
||||||
|
SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$db_name';"
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_psql_remove_db "$db_name" "$app"
|
ynh_psql_remove_db "$db_name" "$app"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue