This commit is contained in:
bananaappletw 2016-12-22 13:23:17 +08:00
parent 8153fa32ed
commit acaeef172a
1 changed files with 4 additions and 3 deletions

View File

@ -13,10 +13,11 @@ var dbconfig = config.db;
dbconfig.logging = config.debug ? logger.info : false; dbconfig.logging = config.debug ? logger.info : false;
var sequelize = null; var sequelize = null;
if (dbconfig.hasOwnProperty('username') || dbconfig.hasOwnProperty('password'))
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig); if (process.env.DATABASE_URL)
sequelize = new Sequelize(process.env.DATABASE_URL, dbconfig.username, dbconfig.password, dbconfig);
else else
sequelize = new Sequelize(dbconfig.database, dbconfig); sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
var db = {}; var db = {};