Fix database connection (host + port)
authorChocobozzz <me@florianbigard.com>
Fri, 15 Dec 2017 07:21:00 +0000 (08:21 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 15 Dec 2017 07:21:00 +0000 (08:21 +0100)
server/initializers/database.ts

index 2260938b1dcc9bceddf0edf8b7560decc2ed6230..85d205cdcc071561ff8b38976812396e690f1244 100644 (file)
@@ -28,13 +28,16 @@ require('pg').defaults.parseInt8 = true // Avoid BIGINT to be converted to strin
 const dbname = CONFIG.DATABASE.DBNAME
 const username = CONFIG.DATABASE.USERNAME
 const password = CONFIG.DATABASE.PASSWORD
+const host = CONFIG.DATABASE.HOSTNAME
+const port = CONFIG.DATABASE.PORT
 
 const sequelizeTypescript = new SequelizeTypescript({
   database: dbname,
   dialect: 'postgres',
+  host,
+  port,
   username,
   password,
-  modelPaths: [__dirname + '/models'],
   benchmark: isTestInstance(),
   isolationLevel: SequelizeTypescript.Transaction.ISOLATION_LEVELS.SERIALIZABLE,
   operatorsAliases: false,