Skip to content

Commit 43c2c5e

Browse files
authored
Merge pull request #388 from boostcampwm-2024/fix/tag-insertion-error
🐛 fix: tag insert 에러 수정
2 parents 83a5535 + c6c75ce commit 43c2c5e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

feed-crawler/src/repository/tag-map.repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

server/src/common/database/load.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { ConfigService } from '@nestjs/config';
22

33
export 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
}

0 commit comments

Comments
 (0)