Dropdb has a handy argument for conditionally dropping a database
This commit is contained in:
parent
d595ef60d3
commit
b059605b37
@ -40,9 +40,7 @@ reset_db() {
|
|||||||
local database_name="${1}"
|
local database_name="${1}"
|
||||||
|
|
||||||
# If the DB exists, drop it
|
# If the DB exists, drop it
|
||||||
set +e
|
dropdb --if-exists "${database_name}"
|
||||||
dropdb "${database_name}"
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Create a fresh DB
|
# Create a fresh DB
|
||||||
createdb "${database_name}"
|
createdb "${database_name}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user