Skip to content

hotfix(chat): notification_enabled 컬럼 DEFAULT 누락 수정#119

Open
ThonApple wants to merge 1 commit into
developfrom
fix/chat-room-member-notification-default
Open

hotfix(chat): notification_enabled 컬럼 DEFAULT 누락 수정#119
ThonApple wants to merge 1 commit into
developfrom
fix/chat-room-member-notification-default

Conversation

@ThonApple
Copy link
Copy Markdown
Collaborator

@ThonApple ThonApple commented May 29, 2026

요약

  • ChatRoomMember.notification_enabled 컬럼에 columnDefinition = "boolean NOT NULL DEFAULT true" 추가
  • Hibernate ddl-auto:update가 ALTER TABLE 발행 시 DEFAULT true 포함 → Postgres가 기존 행을 자동으로 true로 채움
  • 이 수정 전까지 컬럼 미생성으로 인한 ChatRoomMember INSERT 500 에러가 발생 중이었음

Closes #118

변경 파일

  • capstone-domain/.../chat/entity/ChatRoomMember.java@Column annotation에 columnDefinition 추가 (1줄 변경)

테스트 플랜

  • ./gradlew compileJava 통과
  • ./gradlew checkstyleMainChatRoomMember.java 위반 0건 (선재 WARN 그대로)
  • 배포 후 Neon DB에서 ALTER TABLE chat_room_members ADD COLUMN notification_enabled boolean NOT NULL DEFAULT true 정상 실행 확인
  • ensureGroupRoomForPost() 경로 INSERT 정상 동작 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated database schema configuration for chat room member notifications to ensure consistent default behavior when new members are added.

Review Change Stack

Closes #118

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ThonApple ThonApple requested review from ca5tlechan and hoTan35 May 29, 2026 09:05
@ThonApple
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@ThonApple, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 6 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1aaacbb4-10ba-4818-b564-b1fcf8e305ac

📥 Commits

Reviewing files that changed from the base of the PR and between 1d0463b and 593623b.

📒 Files selected for processing (1)
  • capstone-domain/src/main/java/backend/chat/entity/ChatRoomMember.java
📝 Walkthrough

Walkthrough

A single-line update to the ChatRoomMember entity adds an explicit SQL DEFAULT value to the notificationEnabled column definition, ensuring PostgreSQL can add the column to existing tables without constraint violations during schema migrations.

Changes

Notification enabled column SQL default

Layer / File(s) Summary
Notification column SQL default mapping
capstone-domain/src/main/java/backend/chat/entity/ChatRoomMember.java
notificationEnabled field's @Column annotation adds columnDefinition = "boolean NOT NULL DEFAULT true", forcing Hibernate DDL generation to include the SQL DEFAULT clause required by PostgreSQL when altering existing tables.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A column once stood without its default so true,
PostgreSQL said "No way! What shall I do?"
But Hibernate now knows, with columnDefinition's might,
DEFAULT true is set—every insert is right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the missing DEFAULT constraint to the notification_enabled column in ChatRoomMember entity.
Description check ✅ Passed The description covers the summary, specific changes made, issue reference, and test plan, following the repository template structure.
Linked Issues check ✅ Passed The code change directly addresses issue #118 by adding columnDefinition with DEFAULT true to enable proper DDL generation and prevent INSERT errors.
Out of Scope Changes check ✅ Passed The single-line change is scoped entirely to fixing the notification_enabled column mapping as specified in issue #118, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/chat-room-member-notification-default

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Collaborator

@ca5tlechan ca5tlechan left a comment

Choose a reason for hiding this comment

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

✅ Approve — Blocking 없음

✅ 확인 사항

  • columnDefinition = "boolean NOT NULL DEFAULT true" 추가 — ddl-auto=create/update 시 Hibernate가 DEFAULT 포함 DDL을 생성해 기존 행 NOT NULL 제약 위반 방지 ✅
  • @Builder.Default(true) 자바 레벨 디폴트와 일치 ✅

⚠️ Non-blocking

nullable = falsecolumnDefinitionNOT NULL이 중복이나 무해합니다. ddl-auto=update + 이미 컬럼이 존재하는 DB에서는 columnDefinition이 기존 컬럼 정의를 변경하지 않으므로, 완전한 해결은 PR #103 리뷰에서 제안한 migration SQL(ALTER TABLE chat_room_members ADD COLUMN IF NOT EXISTS notification_enabled BOOLEAN NOT NULL DEFAULT TRUE)이 함께 있어야 합니다. 개발 환경(ddl-auto=create) 기준으로는 이 수정으로 충분합니다.

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.

hotfix: ChatRoomMember notification_enabled 컬럼 DEFAULT 누락으로 INSERT 500

2 participants