mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +03:00
Merge pull request #6959 from kirrg001/improvement/db-connection
improvement: improve db/connection.js readability
This commit is contained in:
commit
015802b6eb
@ -1,6 +1,5 @@
|
||||
var knex = require('knex'),
|
||||
config = require('../../config'),
|
||||
dbConfig = config.database,
|
||||
knexInstance;
|
||||
|
||||
function configure(dbConfig) {
|
||||
@ -47,8 +46,8 @@ function configure(dbConfig) {
|
||||
return dbConfig;
|
||||
}
|
||||
|
||||
if (!knexInstance && dbConfig && dbConfig.client) {
|
||||
knexInstance = knex(configure(dbConfig));
|
||||
if (!knexInstance && config.database && config.database.client) {
|
||||
knexInstance = knex(configure(config.database));
|
||||
}
|
||||
|
||||
module.exports = knexInstance;
|
||||
|
Loading…
Reference in New Issue
Block a user