Repository navigation
fix: 관리자 권한 역방향 이전 및 인증 로그 보강 - #169
Merged
Merged
Conversation
9 of 15 tasks
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.
작업 내용
club_manager의(club_id, service_user_id)전체 이력 UNIQUE 제약을 제거하는 migration을 추가했습니다. soft-delete 이력은 보존하고,deleted_at IS NULL인 행에 대한 기존 partial unique index로 동아리별 활성 관리자 1명 조건을 유지합니다.23505제약 충돌만 안전한 409로 매핑하고, 예상하지 못한 DB 오류는 500으로 유지하면서 로그에는 오류 이름·SQLSTATE·제약 이름만 남기도록 했습니다.TEST_DATABASE_URL을 테스트 task에 전달하도록 구성했습니다.변경 이유
club_manager행은 soft-delete 이력으로 남습니다. 다시 B → A를 수행하면(club_id, service_user_id)전체 행 UNIQUE 제약이 과거 A 행과 새 A 행을 충돌시켜 이전 transaction 전체가 실패했습니다.23505는unique_violation입니다. PostgreSQL error codes테스트한 내용
club_manager_clubid_serviceuserid충돌로 실패하고, transaction rollback으로 B만 활성 상태이며 초대가 미수락 상태로 남는 것을 확인했습니다.apps/web/sql/260904_club_manager_reversal.sql적용 뒤 동일 초대를 재시도해 A가 다시 활성 관리자가 되고, 이력[A 비활성, B 비활성, A 활성]과 알림 1회, 재수락 멱등성을 확인했습니다.TEST_DATABASE_URL=... pnpm exec turbo run lint typecheck test --forcepnpm --dir apps/mobile verify:full통과: 26 suites / 148 tests, Android/iOS JS bundle 성공.pnpm --dir apps/web biome:check통과.pnpm --dir apps/web buildproduction build 성공. 테스트 파일이 API route로 포함되지 않음을 route 목록으로 확인했습니다.Migration 적용 순서 / 운영 주의
apps/web/sql/260904_club_manager_reversal.sql을 대상 DB에 수동 적용합니다. 이 PR 작업에서는 allclear-dev 및 production DB에 적용하지 않았습니다.ALTER TABLE ... DROP CONSTRAINT는 일반적으로ACCESS EXCLUSIVElock을 획득하므로 낮은 트래픽 시간에 적용하고 transaction이 짧게 끝나는지 확인합니다. PostgreSQL ALTER TABLE 문서스크린샷 (선택)
체크
남은 수동 QA
CI 결과