Drop the database and its owner
This commit is contained in:
parent
09759b7da5
commit
b6ea8db5c6
|
@ -342,7 +342,7 @@ function remove_peertube {
|
|||
sed -i '/peertube/d' $COMPLETION_FILE
|
||||
|
||||
function_check drop_database_postgresql
|
||||
drop_database_postgresql peertube
|
||||
drop_database_postgresql peertube peertube
|
||||
|
||||
remove_postgresql_user peertube
|
||||
groupdel -f peertube
|
||||
|
|
|
@ -124,8 +124,12 @@ function remove_postgresql_user {
|
|||
|
||||
function drop_database_postgresql {
|
||||
database_name="$1"
|
||||
database_owner_name="$2"
|
||||
cd /etc/postgresql
|
||||
sudo -u postgres psql -c "drop database $database_name"
|
||||
if [ ${#database_owner_name} -gt 0 ]; then
|
||||
sudo -u postgres psql -c "drop user $database_owner_name"
|
||||
fi
|
||||
}
|
||||
|
||||
function run_system_query_postgresql {
|
||||
|
|
Loading…
Reference in New Issue