Update mysql: add default_character_set option to ynh_mysql_dump_db

This commit is contained in:
Alexandre Aubin 2024-05-19 15:46:58 +02:00 committed by GitHub
parent 5babe3dce6
commit 85d5ed1284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,13 +136,15 @@ ynh_mysql_drop_db() {
# Requires YunoHost version 2.2.4 or higher.
ynh_mysql_dump_db() {
# Declare an array to define the options of this helper.
local legacy_args=d
local -A args_array=([d]=database=)
local legacy_args=dc
local -A args_array=( [d]=database= [c]=default_character_set= )
local database
local default_character_set
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
default_character_set="${default_character_set:-latin1}"
mysqldump --single-transaction --skip-dump-date --routines "$database"
mysqldump --single-transaction --skip-dump-date --routines --default-character-set=$default_character_set "$database"
}
# Create a user