Skip to content

Commit

Permalink
Merge pull request #44 from klaus9267/develop
Browse files Browse the repository at this point in the history
Refactor(#40) 이모지 변경, bulk api 조회 범위 수정
  • Loading branch information
klaus9267 authored Jul 29, 2024
2 parents b1e4277 + 5571d0a commit 39e0163
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/kimandhong/oxox/bulk/BulkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public void bulkReactions() {

A:
for (int i = 0; i < 10000; i++) {
int randomUserId = random.nextInt(users.size() - 1);
int randomCommentId = random.nextInt(comments.size() - 1);
int randomUserId = random.nextInt(users.size());
int randomCommentId = random.nextInt(comments.size());
int randomEmoji = random.nextInt(Emoji.values().length - 1);
Comment randomComment = comments.get(randomCommentId);

Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/db/migration/V4__change_reaction_emojis.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- 기존 ENUM을 새로운 ENUM으로 변경
ALTER TABLE `reactions`
CHANGE `emoji` `emoji` enum('SMILE','SHOCK','HEART','CRY','ANGRY','NONE') COLLATE utf8mb4_general_ci DEFAULT NULL;

-- 기존 데이터 값 변경을 위해 필요한 경우 업데이트 쿼리 작성
UPDATE `reactions` SET `emoji` = 'NONE' WHERE `emoji` IS NULL;

-- 기존 ENUM을 새로운 ENUM으로 변경
ALTER TABLE `reaction_counts`
CHANGE `emoji` `emoji` enum('SMILE','SHOCK','HEART','CRY','ANGRY') COLLATE utf8mb4_general_ci NOT NULL;

0 comments on commit 39e0163

Please sign in to comment.