@bearei/server-common 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,11 +5,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.DatabaseModule = void 0;
|
|
10
13
|
const common_1 = require("@nestjs/common");
|
|
11
14
|
const config_1 = require("@nestjs/config");
|
|
12
15
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
16
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
17
|
let DatabaseModule = class DatabaseModule {
|
|
14
18
|
};
|
|
15
19
|
exports.DatabaseModule = DatabaseModule;
|
|
@@ -22,11 +26,13 @@ exports.DatabaseModule = DatabaseModule = __decorate([
|
|
|
22
26
|
database: configService.get('database.database'),
|
|
23
27
|
entities: configService.get('database.entities'),
|
|
24
28
|
host: configService.get('database.host'),
|
|
29
|
+
migrations: [
|
|
30
|
+
node_path_1.default.join(__dirname, 'database/migrations', `*.${process.env.NODE_ENV === 'production' ? 'js' : 'ts'}`)
|
|
31
|
+
],
|
|
25
32
|
password: configService.get('database.password'),
|
|
26
33
|
port: configService.get('database.port'),
|
|
27
34
|
type: configService.get('database.type'),
|
|
28
35
|
username: configService.get('database.username'),
|
|
29
|
-
synchronize: false,
|
|
30
36
|
extra: {
|
|
31
37
|
connectionTimeoutMillis: 2000,
|
|
32
38
|
idleTimeoutMillis: 30000,
|
|
@@ -34,7 +40,8 @@ exports.DatabaseModule = DatabaseModule = __decorate([
|
|
|
34
40
|
},
|
|
35
41
|
...(process.env.NODE_ENV !== 'production' && {
|
|
36
42
|
logger: 'advanced-console',
|
|
37
|
-
logging: true
|
|
43
|
+
logging: true,
|
|
44
|
+
synchronize: true
|
|
38
45
|
})
|
|
39
46
|
}),
|
|
40
47
|
inject: [config_1.ConfigService]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../src/database/database.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../src/database/database.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAqC;AACrC,2CAA0D;AAC1D,6CAA6C;AAC7C,0DAA4B;AAoCrB,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAlC1B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE;YACR,uBAAa,CAAC,YAAY,CAAC;gBAC1B,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;oBAC7B,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC;oBAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC;oBAChD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC;oBACxC,UAAU,EAAE;wBACX,mBAAI,CAAC,IAAI,CACR,SAAS,EACT,qBAAqB,EACrB,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAC1D;qBACD;oBACD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC;oBAChD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC;oBACxC,IAAI,EAAE,aAAa,CAAC,GA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