Skip to content
Snippets Groups Projects
Commit b6ea8db5 authored by Bob Mottram's avatar Bob Mottram
Browse files

Drop the database and its owner

parent 09759b7d
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment