From 148138077552c6fbba6b71df0565da93176eebd2 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Thu, 30 Dec 2021 18:41:52 -0500 Subject: [PATCH] Add warning when DB_CHARSET isn't explicitly configured (#10778) * Add warning when DB_CHARSET isn't explicitly configured Fixes #10556 * Improve messaging --- api/src/database/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/database/index.ts b/api/src/database/index.ts index 3559b0ef86..afd5593994 100644 --- a/api/src/database/index.ts +++ b/api/src/database/index.ts @@ -92,6 +92,10 @@ export default function getDatabase(): Knex { merge(knexConfig, { connection: { options: { useUTC: false } } }); } + if (env.DB_CLIENT === 'mysql' && !env.DB_CHARSET) { + logger.warn(`DB_CHARSET hasn't been set. Please make sure DB_CHARSET matches your database's collation.`); + } + database = knex(knexConfig); const times: Record = {};