Update sequelize init condition
This commit is contained in:
parent
74c1da4536
commit
5282bf491e
1 changed files with 4 additions and 5 deletions
|
@ -12,12 +12,11 @@ var logger = require("../logger.js");
|
||||||
var dbconfig = config.db;
|
var dbconfig = config.db;
|
||||||
dbconfig.logging = config.debug ? logger.info : false;
|
dbconfig.logging = config.debug ? logger.info : false;
|
||||||
|
|
||||||
var sequelize;
|
var sequelize = null;
|
||||||
if (typeof dbconfig.username === 'undefined' && typeof dbconfig.password === 'undefined') {
|
if (dbconfig.hasOwnProperty('username') || dbconfig.hasOwnProperty('password'))
|
||||||
sequelize = new Sequelize(dbconfig.database, dbconfig);
|
|
||||||
} else {
|
|
||||||
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
|
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
|
||||||
}
|
else
|
||||||
|
sequelize = new Sequelize(dbconfig.database, dbconfig);
|
||||||
|
|
||||||
var db = {};
|
var db = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue