Merge pull request #1015 from yalh76/patch-1

Change to be consistent with mysql helper
This commit is contained in:
Alexandre Aubin 2020-06-04 02:10:00 +02:00 committed by GitHub
commit 77516fa9eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,7 +213,7 @@ ynh_psql_drop_user() {
# usage: ynh_psql_setup_db --db_user=user --db_name=name [--db_pwd=pwd]
# | arg: -u, --db_user= - Owner of the database
# | arg: -n, --db_name= - Name of the database
# | arg: -p, --db_pwd= - Password of the database. If not given, a password will be generated
# | arg: -p, --db_pwd= - Password of the database. If not provided, a password will be generated
#
# After executing this helper, the password of the created database will be available in $db_pwd
# It will also be stored as "psqlpwd" into the app settings.
@ -231,7 +231,7 @@ ynh_psql_setup_db() {
if ! ynh_psql_user_exists --user=$db_user; then
local new_db_pwd=$(ynh_string_random) # Generate a random password
# If $db_pwd is not given, use new_db_pwd instead for db_pwd
# If $db_pwd is not provided, use new_db_pwd instead for db_pwd
db_pwd="${db_pwd:-$new_db_pwd}"
ynh_psql_create_user "$db_user" "$db_pwd"