Skip to content

[level] 레벨을 0부터 시작 (currentLevel=완료 미션 수)#271

Merged
Develop-KIM merged 1 commit into
developfrom
feat/level-zero-start
Jun 30, 2026
Merged

[level] 레벨을 0부터 시작 (currentLevel=완료 미션 수)#271
Develop-KIM merged 1 commit into
developfrom
feat/level-zero-start

Conversation

@Develop-KIM

Copy link
Copy Markdown
Member

변경

"신규 유저 = Lv.0, 미션 깨면 +1" 모델로 전환. currentLevel = 완료한 미션 수(0~10).

  • UserLevel 기본값 0, 프로필 기본 레벨 0
  • 현재 미션 = findByLevel(currentLevel + 1) — 미션 정의(Lv.1~Lv.10 시드)는 그대로
    • 신규/회고 전: currentLevel=0 → 현재 미션 Lv.1(첫 회고)
    • 미션 완료 → currentLevel+1, 다음 미션(currentLevel+1) 생성
    • Lv.10 미션 완료 → currentLevel=10 (종료)
  • 운영 통계 레벨 분포 0~10, UserLevel 행 없는 유저 = Lv.0
  • V43 마이그레이션: 기존 user_levels 1-base→0-base 보정(current_level - 1) + 컬럼 기본값 0
  • 배지/스트릭은 손대지 않음 (레벨과 독립 시스템)

의존

  • 홈 집계 PR #270은 /home에 mission을 포함하므로 이 PR과 함께/이후 머지 시 0-base 레벨이 일관되게 노출됨.

🤖 Generated with Claude Code

- UserLevel 기본값 0, 프로필 기본 레벨 0
- 현재 미션 = findByLevel(currentLevel+1), 미션 정의(Lv.1~10)는 유지
- awardNextLevel: 다음 미션레벨=currentLevel+1, Lv.10 완료 시 종료
- 운영 통계 레벨 분포 0~10, 행 없는 유저=Lv.0
- V43: 기존 user_levels 1-base→0-base 보정 + 기본값 0
- 배지/스트릭은 변경 없음

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 233a1887c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

-- 기존 1-base(시작=1) 데이터를 0-base로 한 칸 내리고, 기본값을 0으로 변경한다.
ALTER TABLE user_levels MODIFY current_level INT NOT NULL DEFAULT 0;

UPDATE user_levels SET current_level = current_level - 1 WHERE current_level > 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve users who already completed Lv10

For production data where a user has already completed the level-10 mission, the old code left user_levels.current_level at 10 because awardNextLevel() returned when currentLevel >= 10; this migration unconditionally rewrites that row to 9. Since the new meaning is “completed mission count,” those maxed-out users should remain at 10, otherwise profiles/admin stats permanently demote them until some separate repair runs. Consider special-casing rows with a completed user_missions entry joined to missions.level = 10 before applying the blanket - 1 conversion.

Useful? React with 👍 / 👎.

@Develop-KIM Develop-KIM merged commit 322c018 into develop Jun 30, 2026
3 checks passed
@Develop-KIM Develop-KIM deleted the feat/level-zero-start branch June 30, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant