comparison schema/install-db.sh @ 465:ab07eb290fa3

Drop metamorph role too when tearing down database.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 Aug 2018 17:21:25 +0200
parents 5611cf72cc92
children 638371a0e557
comparison
equal deleted inserted replaced
464:b31eb28d1fcb 465:ab07eb290fa3
137 echo "Really drop database '$db' and all gemma roles? [type 'yes']: " 137 echo "Really drop database '$db' and all gemma roles? [type 'yes']: "
138 read a 138 read a
139 if [[ $a == "yes" ]] ; then 139 if [[ $a == "yes" ]] ; then
140 dropdb -p "$port" "$db" 140 dropdb -p "$port" "$db"
141 psql -p $port -A -t -c '\du' | awk -F '|' -v port=$port \ 141 psql -p $port -A -t -c '\du' | awk -F '|' -v port=$port \
142 '$1 "." $3 ~ /waterway_user|waterway_admin|sys_admin|pw_reset/ \ 142 '$1 "." $3 ~ /waterway_user|waterway_admin|sys_admin|pw_reset|metamorph/ \
143 { system("dropuser -p " port " \"" $1 "\"") }' 143 { system("dropuser -p " port " \"" $1 "\"") }'
144 else 144 else
145 echo "No harm done." 145 echo "No harm done."
146 fi 146 fi
147 fi 147 fi