[db] 구 배지 획득 기록(orphan user_badges) 정리 V42#267
Merged
Conversation
V39 배지 재정의 이후 새 badge_id로 갈아끼우면서 보존된 구 스트릭 시절 획득 기록(orphan)을 삭제. 현재 badges에 없는 badge_id의 user_badges 제거. 배포 시점부터 신규 배지는 다음 트리거 이벤트부터 평가/부여(소급 없음). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
V39 배지 재정의에서
DELETE FROM badges후 새 UUID로 10종을 재시드하면서user_badges(획득 기록)는 보존했습니다. 그 결과 구 스트릭 시절 획득분이 현재 배지에 없는 badge_id를 가리키는 orphan으로 DB에 남아 있습니다(코드는 mapNotNull로 숨김).변경
V42__cleanup_orphan_user_badges.sql:badge_id NOT IN (SELECT id FROM badges)인 user_badges 삭제영향 / 정책
🤖 Generated with Claude Code