diff options
author | Max Wu | 2016-12-22 22:29:52 +0800 |
---|---|---|
committer | GitHub | 2016-12-22 22:29:52 +0800 |
commit | 8cf849e825e96510c064479bbf89b595e6728511 (patch) | |
tree | e661253d4393ecc61772548fda7f457e92f689ac /lib/models | |
parent | 8153fa32ed963f3c8b122dd673bb3ab64323e2ab (diff) | |
parent | c58f28a9d43804018c94fd2899b50863f1b5a2b6 (diff) |
Merge pull request #294 from bananaappletw/master
Fix #293
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/models/index.js b/lib/models/index.js index d52f5508..de6cd13c 100644 --- a/lib/models/index.js +++ b/lib/models/index.js @@ -13,10 +13,12 @@ var dbconfig = config.db; dbconfig.logging = config.debug ? logger.info : false; var sequelize = null; -if (dbconfig.hasOwnProperty('username') || dbconfig.hasOwnProperty('password')) - sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig); + +// Heroku specific +if (config.dburl) + sequelize = new Sequelize(config.dburl, dbconfig); else - sequelize = new Sequelize(dbconfig.database, dbconfig); + sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig); var db = {}; |