docs: update DB V3 checklist — Phase 1-4 implemented

Phase 1:  DB migration (9 tables + 2 views)
Phase 2:  discover-channels dual-write
Phase 3:  collect-channel-data dual-write
Phase 4:  generate-report dual-write
Phase 5:  Performance loop (pending)
Phase 6:  Frontend transition (pending)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
claude/bold-hawking
Haewon Kam 2026-04-05 00:54:52 +09:00
parent 7fe3ff82c9
commit 2f2aa5a5b6
1 changed files with 18 additions and 18 deletions

View File

@ -197,36 +197,36 @@ Week N+1:
### Phase 1: DB 마이그레이션 (테이블 생성) ### Phase 1: DB 마이그레이션 (테이블 생성)
- [ ] Supabase Dashboard에서 `20260405_saas_schema_v3.sql` 실행 - [x] Supabase Dashboard에서 `20260405_saas_schema_v3.sql` 실행
- [ ] 테이블 9개 생성 확인: clinics, analysis_runs, channel_snapshots, screenshots, content_plans, channel_configs, performance_metrics, content_performance, strategy_adjustments - [x] 테이블 9개 생성 확인: clinics, analysis_runs, channel_snapshots, screenshots, content_plans, channel_configs, performance_metrics, content_performance, strategy_adjustments
- [ ] View 2개 생성 확인: channel_latest, channel_weekly_delta - [x] View 2개 생성 확인: channel_latest, channel_weekly_delta
- [ ] RLS 정책 적용 확인 - [x] RLS 정책 적용 확인
- [ ] 인덱스 생성 확인 - [x] 인덱스 생성 확인
### Phase 2: Edge Function 전환 — discover-channels ### Phase 2: Edge Function 전환 — discover-channels
- [ ] `discover-channels/index.ts`: `clinics` 테이블에 UPSERT (url 기준) - [x] `discover-channels/index.ts`: `clinics` 테이블에 UPSERT (url 기준)
- [ ] `discover-channels/index.ts`: `analysis_runs` 테이블에 INSERT (status: 'discovering') - [x] `discover-channels/index.ts`: `analysis_runs` 테이블에 INSERT (status: 'discovering')
- [ ] `discover-channels/index.ts`: `clinic.verified_channels` 업데이트 - [x] `discover-channels/index.ts`: `clinic.verified_channels` 업데이트
- [ ] 기존 `marketing_reports`에도 병행 쓰기 유지 (호환성) - [x] 기존 `marketing_reports`에도 병행 쓰기 유지 (호환성)
- [ ] 검증: 분석 실행 → clinics + analysis_runs 행 생성 확인 - [ ] 검증: 분석 실행 → clinics + analysis_runs 행 생성 확인
### Phase 3: Edge Function 전환 — collect-channel-data ### Phase 3: Edge Function 전환 — collect-channel-data
- [ ] `collect-channel-data/index.ts`: `channel_snapshots`에 채널별 INSERT - [x] `collect-channel-data/index.ts`: `channel_snapshots`에 채널별 INSERT
- [ ] `collect-channel-data/index.ts`: `screenshots`에 스크린샷 INSERT - [x] `collect-channel-data/index.ts`: `screenshots`에 스크린샷 INSERT
- [ ] `collect-channel-data/index.ts`: `analysis_runs.raw_channel_data` 업데이트 - [x] `collect-channel-data/index.ts`: `analysis_runs.raw_channel_data` 업데이트
- [ ] `collect-channel-data/index.ts`: `analysis_runs.vision_analysis` 업데이트 - [x] `collect-channel-data/index.ts`: `analysis_runs.vision_analysis` 업데이트
- [ ] 기존 `marketing_reports.channel_data`에도 병행 쓰기 유지 - [x] 기존 `marketing_reports.channel_data`에도 병행 쓰기 유지
- [ ] 검증: channel_snapshots에 채널별 행 생성 확인 - [ ] 검증: channel_snapshots에 채널별 행 생성 확인
### Phase 4: Edge Function 전환 — generate-report ### Phase 4: Edge Function 전환 — generate-report
- [ ] `generate-report/index.ts`: `analysis_runs.report` 업데이트 - [x] `generate-report/index.ts`: `analysis_runs.report` 업데이트
- [ ] `generate-report/index.ts`: `analysis_runs.status = 'complete'` - [x] `generate-report/index.ts`: `analysis_runs.status = 'complete'`
- [ ] `generate-report/index.ts`: `clinics.last_analyzed_at` 업데이트 - [x] `generate-report/index.ts`: `clinics.last_analyzed_at` 업데이트
- [ ] `content_plans` 자동 생성 (transformPlan 로직 서버사이드 이동) - [ ] `content_plans` 자동 생성 (transformPlan 로직 서버사이드 이동)
- [ ] 기존 `marketing_reports.report`에도 병행 쓰기 유지 - [x] 기존 `marketing_reports.report`에도 병행 쓰기 유지
- [ ] 검증: analysis_runs.status = 'complete' + report JSONB 생성 확인 - [ ] 검증: analysis_runs.status = 'complete' + report JSONB 생성 확인
### Phase 5: 성과 분석 루프 구현 ### Phase 5: 성과 분석 루프 구현