File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
server/src/common/database Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import { ConfigService } from '@nestjs/config';
22
33export function loadDBSetting ( configService : ConfigService ) {
44 const env = process . env . NODE_ENV ;
5- const isDev = env === 'LOCAL' || env === 'DEV' || env === 'TEST' ;
5+ const isDev = env === 'LOCAL' || env === 'DEV' ;
6+ const isTest = env === 'TEST' ;
67
78 return {
89 type : configService . get < 'mysql' | 'sqlite' > ( 'DB_TYPE' ) ,
@@ -13,9 +14,9 @@ export function loadDBSetting(configService: ConfigService) {
1314 password : configService . get < string > ( 'DB_PASSWORD' ) ,
1415 entities : [ `${ __dirname } /../../**/*.entity.{js,ts}` ] ,
1516
16- synchronize : isDev ,
17+ synchronize : isDev || isTest ,
1718 migrations : [ `${ __dirname } /../../migration/*.{js,ts}` ] ,
18- migrationsRun : ! isDev ,
19+ migrationsRun : ! ( isDev || isTest ) ,
1920 logging : isDev ,
2021 } ;
2122}
You can’t perform that action at this time.
0 commit comments