Dropdb has a handy argument for conditionally dropping a database

This commit is contained in:
raydds 2020-01-16 11:52:18 -05:00
parent d595ef60d3
commit b059605b37

View File

@ -40,9 +40,7 @@ reset_db() {
local database_name="${1}"
# If the DB exists, drop it
set +e
dropdb "${database_name}"
set -e
dropdb --if-exists "${database_name}"
# Create a fresh DB
createdb "${database_name}"