mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
improvement: improve db/connection.js readability
This commit is contained in:
parent
6826a6516b
commit
901c9d75a0
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue