changeset 2679:a3cab473304d

Drop roles even if database does not exist
author Tom Gottfried <tom@intevation.de>
date Fri, 15 Mar 2019 12:06:04 +0100
parents 906e9a13592f
children bd615f978164
files schema/install-db.sh
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/schema/install-db.sh	Fri Mar 15 11:14:21 2019 +0100
+++ b/schema/install-db.sh	Fri Mar 15 12:06:04 2019 +0100
@@ -158,7 +158,7 @@
   echo "Really drop database '$db' and all gemma roles? [type 'yes']: "
   read a
   if [[ $a == "yes" ]] ; then
-    dropdb -p "$port" "$db"
+    dropdb --if-exists -p "$port" "$db"
     psql -p $port -A -t -c '\du' | awk -F '|' -v port=$port \
         '$1 "." $3 ~ /waterway_user|waterway_admin|sys_admin|metamorph/ \
 	    { system("dropuser -p " port " \"" $1 "\"") }'