mirror of https://github.com/status-im/codimd.git
Update sequelize init condition
This commit is contained in:
parent
74c1da4536
commit
5282bf491e
|
@ -12,12 +12,11 @@ var logger = require("../logger.js");
|
|||
var dbconfig = config.db;
|
||||
dbconfig.logging = config.debug ? logger.info : false;
|
||||
|
||||
var sequelize;
|
||||
if (typeof dbconfig.username === 'undefined' && typeof dbconfig.password === 'undefined') {
|
||||
sequelize = new Sequelize(dbconfig.database, dbconfig);
|
||||
} else {
|
||||
var sequelize = null;
|
||||
if (dbconfig.hasOwnProperty('username') || dbconfig.hasOwnProperty('password'))
|
||||
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
|
||||
}
|
||||
else
|
||||
sequelize = new Sequelize(dbconfig.database, dbconfig);
|
||||
|
||||
var db = {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue