Skip to content

Commit acaeef1

Browse files
committed
Fix #293
1 parent 8153fa3 commit acaeef1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/models/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ var dbconfig = config.db;
1313
dbconfig.logging = config.debug ? logger.info : false;
1414

1515
var sequelize = null;
16-
if (dbconfig.hasOwnProperty('username') || dbconfig.hasOwnProperty('password'))
17-
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
16+
17+
if (process.env.DATABASE_URL)
18+
sequelize = new Sequelize(process.env.DATABASE_URL, dbconfig.username, dbconfig.password, dbconfig);
1819
else
19-
sequelize = new Sequelize(dbconfig.database, dbconfig);
20+
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
2021

2122
var db = {};
2223

0 commit comments

Comments
 (0)