From 42f0e58f7e9278205353a99259794ada6529e2ef Mon Sep 17 00:00:00 2001 From: Dan Caddigan Date: Mon, 18 Mar 2019 13:03:27 -0400 Subject: [PATCH] fix(subscribers): respect TypeORM configuration option (#68) --- src/core/code-generator.ts | 2 +- src/torm/createConnection.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/code-generator.ts b/src/core/code-generator.ts index 385b1856..01a46e12 100644 --- a/src/core/code-generator.ts +++ b/src/core/code-generator.ts @@ -135,7 +135,7 @@ module.exports = { namingStrategy: new SnakeNamingStrategy(), password: process.env.TYPEORM_PASSWORD, port: parseInt(process.env.TYPEORM_PORT || '', 10) || 5432, - subscribers: ['src/**/*.model.ts'], + subscribers: process.env.TYPEORM_SUBSCRIBERS || ['src/**/*.model.ts'], synchronize: process.env.TYPEORM_SYNCHRONIZE === 'true', type: 'postgres', username: process.env.TYPEORM_USERNAME diff --git a/src/torm/createConnection.ts b/src/torm/createConnection.ts index e9981b7e..74fb41b6 100644 --- a/src/torm/createConnection.ts +++ b/src/torm/createConnection.ts @@ -46,7 +46,7 @@ function getBaseConfig() { namingStrategy: new SnakeNamingStrategy(), password: process.env.TYPEORM_PASSWORD, port: parseInt(process.env.TYPEORM_PORT || '', 10) || 5432, - subscribers: ['src/**/*.model.ts'], + subscribers: process.env.TYPEORM_SUBSCRIBERS || ['src/**/*.model.ts'], synchronize: process.env.TYPEORM_SYNCHRONIZE === 'true', type: 'postgres', username: process.env.TYPEORM_USERNAME