pull/7839/merge
Karl Berggren 3 weeks ago committed by GitHub
commit 5e09ec44da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -31,6 +31,7 @@ module.exports = {
let dbClient = null
let dbConfig = (!_.isEmpty(process.env.DATABASE_URL)) ? process.env.DATABASE_URL : {
host: WIKI.config.db.host.toString(),
socketPath: WIKI.config.db.socketPath.toString(),
user: WIKI.config.db.user.toString(),
password: WIKI.config.db.pass.toString(),
database: WIKI.config.db.db.toString(),
@ -91,6 +92,12 @@ module.exports = {
dbConfig.ssl = sslOptions
}
// Prune host and port if socketPath is configured
if (dbConfig.socketPath) {
const { host, port, ...prunedConfig} = dbConfig;
dbConfig = prunedConfig;
}
// Fix mysql boolean handling...
dbConfig.typeCast = (field, next) => {
if (field.type === 'TINY' && field.length === 1) {

Loading…
Cancel
Save