create_database.sh: support full UTF-8 support (utf8mb4).

This commit is contained in:
Christoph 2020-05-26 00:04:01 +02:00
parent 65038c3b9a
commit 6849cf5c72

View File

@ -627,12 +627,22 @@ if [[ "$_result" = "$DATABASE_NAME" ]] ; then
fatal "Database '$DATABASE_NAME' already exists"
fi
echononl " Create database \033[1m$DATABASE_NAME\033[m"
echononl " Create database \033[1m$DATABASE_NAME\033[m (full UTF-8 support - utf8mb4)"
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
"CREATE DATABASE $DATABASE_NAME CHARACTER SET utf8 COLLATE utf8_general_ci" > $tmp_log_file 2>&1
"CREATE DATABASE $DATABASE_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" > $tmp_log_file 2>&1
if [[ $? -ne 0 ]] ; then
echo_failed
fatal "$(cat $tmp_log_file)"
error "$(cat $tmp_log_file)"
echononl " Create database \033[1m$DATABASE_NAME\033[m (UTF-8 support - utf8)"
mysql $MYSQL_CREDENTIAL_ARGS -N -s -e \
"CREATE DATABASE $DATABASE_NAME CHARACTER SET utf8 COLLATE utf8_general_ci" > $tmp_log_file 2>&1
if [[ $? -ne 0 ]] ; then
echo_failed
fatal "$(cat $tmp_log_file)"
else
echo_ok
fi
else
echo_ok
fi