Add warning when DB_CHARSET isn't explicitly configured (#10778)

* Add warning when DB_CHARSET isn't explicitly configured

Fixes #10556

* Improve messaging
This commit is contained in:
Rijk van Zanten
2021-12-30 18:41:52 -05:00
committed by GitHub
parent 98cf1349fd
commit 1481380775

View File

@@ -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<string, number> = {};