feat: 멤버당 다중 블로그 등록 지원 (member_blogs 테이블 분리)#83
Merged
Conversation
- members.blog_url/rss_url/rss_consent → member_blogs 테이블로 분리 (멤버당 최대 3개, 블로그별 label·rssConsent) - 백필 마이그레이션 스크립트 추가 (배포 시점에 실행, migrate:member-blogs) - 봇 RSS 폴러: member_blogs 조인 기반 블로그별 폴링 (MemberBlogService) - 웹: 프로필/온보딩/관리자 멤버 폼 다중 블로그 에디터 + 블로그별 RSS 동의 토글 - 프로필/멤버목록/멤버상세에 블로그 다건 표시 - member-blogs 공용 헬퍼(검증·동기화·RSS 비동기 재감지)로 API 일원화 - rss-poller 속성 테스트를 per-blog 폴링 기준으로 갱신 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- syncMemberBlogs를 단일 트랜잭션으로 래핑 (부분 실패 시 롤백) - member_blogs (member_id, blog_url) UNIQUE 제약 추가 (동시 요청 중복 방지) + 백필 DDL 반영 - validateBlogInputs: blog id UUID 형식 검증 - UPDATE WHERE에 member_id 스코프 추가 (방어적) - rss-poller membersPolled를 distinct 멤버 수로 집계 - profile/edit removeBlog 최소 1개 가드, 관리자 폼 aria-invalid per-blog - CLAUDE.md / ARCHITECTURE.md / schema-summary.md 멀티 블로그 반영 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
postgres tagged-template 제네릭이 환경별로 다르게 추론돼 CI에서 TS2349 발생. 정적 SQL(사용자 입력 없음)이므로 .unsafe()로 전환해 호출 시그니처 모호성 제거. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
운영 무중단 배포를 위해 expand/contract 분리: - migrate:member-blogs:expand — member_blogs 생성+백필, members 구컬럼 유지 (비파괴, 운영 중 안전) - migrate:member-blogs:contract — 멱등 재백필 보정 후 members 구컬럼 DROP (신코드 배포·검증 후) - 단일 backfill-member-blogs.ts 제거, package.json/CLAUDE.md 갱신 Co-Authored-By: Claude Opus 4.7 (1M context) <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.
개요
멤버당 블로그 1개 제약을 풀어 최대 3개까지 등록 가능하게 변경. 각 블로그에 선택 이름(label)과 블로그별 RSS 수집 동의.
members.blog_url/rss_url/rss_consent단일 컬럼 → 1:Nmember_blogs테이블로 분리.주요 변경
member_blogs신설 (id, member_id FK cascade, label, blog_url, rss_url, rss_consent, sort_order, timestamps,idx_member_blogs_member_id,UNIQUE(member_id, blog_url)).members에서 blog/rss 컬럼 제거.MAX_BLOGS_PER_MEMBER=3.MemberBlogService.getPollableBlogs()로 active/OB × rss_consent × rss_url 조인 → 블로그별 폴링. dedup 글로벌 URL unique 유지, 점수/출석 멤버 단위 유지.lib/member-blogs.ts공용 헬퍼(검증·트랜잭션 sync·after()RSS 재감지). 프로필/온보딩/관리자 폼 다중 블로그 에디터(최대 3). 프로필/멤버목록/멤버상세 다건 표시.운영 무중단을 위해 expand → 배포 → contract 순서로 진행:
Phase 1 — EXPAND (배포 전/중 아무때나, 비파괴·운영 안전)
member_blogs 생성 + 백필. members 구컬럼은 유지 → 구버전 운영 코드 정상 동작. 이 상태에서 PR 프리뷰(신코드)로 테스트 가능.
Phase 2 — CONTRACT (신코드 운영 배포·검증 완료 후에만)
멱등 재백필 보정 후
members.blog_url/rss_url/rss_consentDROP. 구코드 살아있을 때 실행 금지.각 스크립트 단일 트랜잭션·재실행 안전. 정적 SQL이라
.unsafe()사용(환경별 타입 안정).리뷰 반영 (code-reviewer + security-auditor)
UNIQUE(member_id, blog_url)/ blog id UUID 검증 / UPDATE WHERE memberId 스코프 / removeBlog 최소1개 / aria-invalid per-blogisSafeUrl()+detectRssUrl재검증으로 안전 확인검증
🤖 Generated with Claude Code