File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
feed-crawler/src/repository
server/src/common/database Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export class TagMapRepository {
2929 }
3030
3131 const insertPromises = tag_ids . map ( ( tagId ) => {
32- const query = 'INSERT INTO tag_map (feed_id, tag ) VALUES (?, ?)' ;
32+ const query = 'INSERT INTO tag_map (feed_id, tag_id ) VALUES (?, ?)' ;
3333 return this . dbConnection . executeQuery ( query , [ feedId , tagId ] ) ;
3434 } ) ;
3535
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