From 2f2aa5a5b6ddd7195f50785f8bcc72b1cac437b9 Mon Sep 17 00:00:00 2001 From: Haewon Kam Date: Sun, 5 Apr 2026 00:54:52 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20update=20DB=20V3=20checklist=20?= =?UTF-8?q?=E2=80=94=20Phase=201-4=20implemented?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- doc/DB_SCHEMA_V3.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/DB_SCHEMA_V3.md b/doc/DB_SCHEMA_V3.md index c449f32..ed96bec 100644 --- a/doc/DB_SCHEMA_V3.md +++ b/doc/DB_SCHEMA_V3.md @@ -197,36 +197,36 @@ Week N+1: ### Phase 1: DB 마이그레이션 (테이블 생성) -- [ ] Supabase Dashboard에서 `20260405_saas_schema_v3.sql` 실행 -- [ ] 테이블 9개 생성 확인: clinics, analysis_runs, channel_snapshots, screenshots, content_plans, channel_configs, performance_metrics, content_performance, strategy_adjustments -- [ ] View 2개 생성 확인: channel_latest, channel_weekly_delta -- [ ] RLS 정책 적용 확인 -- [ ] 인덱스 생성 확인 +- [x] Supabase Dashboard에서 `20260405_saas_schema_v3.sql` 실행 +- [x] 테이블 9개 생성 확인: clinics, analysis_runs, channel_snapshots, screenshots, content_plans, channel_configs, performance_metrics, content_performance, strategy_adjustments +- [x] View 2개 생성 확인: channel_latest, channel_weekly_delta +- [x] RLS 정책 적용 확인 +- [x] 인덱스 생성 확인 ### Phase 2: Edge Function 전환 — discover-channels -- [ ] `discover-channels/index.ts`: `clinics` 테이블에 UPSERT (url 기준) -- [ ] `discover-channels/index.ts`: `analysis_runs` 테이블에 INSERT (status: 'discovering') -- [ ] `discover-channels/index.ts`: `clinic.verified_channels` 업데이트 -- [ ] 기존 `marketing_reports`에도 병행 쓰기 유지 (호환성) +- [x] `discover-channels/index.ts`: `clinics` 테이블에 UPSERT (url 기준) +- [x] `discover-channels/index.ts`: `analysis_runs` 테이블에 INSERT (status: 'discovering') +- [x] `discover-channels/index.ts`: `clinic.verified_channels` 업데이트 +- [x] 기존 `marketing_reports`에도 병행 쓰기 유지 (호환성) - [ ] 검증: 분석 실행 → clinics + analysis_runs 행 생성 확인 ### Phase 3: Edge Function 전환 — collect-channel-data -- [ ] `collect-channel-data/index.ts`: `channel_snapshots`에 채널별 INSERT -- [ ] `collect-channel-data/index.ts`: `screenshots`에 스크린샷 INSERT -- [ ] `collect-channel-data/index.ts`: `analysis_runs.raw_channel_data` 업데이트 -- [ ] `collect-channel-data/index.ts`: `analysis_runs.vision_analysis` 업데이트 -- [ ] 기존 `marketing_reports.channel_data`에도 병행 쓰기 유지 +- [x] `collect-channel-data/index.ts`: `channel_snapshots`에 채널별 INSERT +- [x] `collect-channel-data/index.ts`: `screenshots`에 스크린샷 INSERT +- [x] `collect-channel-data/index.ts`: `analysis_runs.raw_channel_data` 업데이트 +- [x] `collect-channel-data/index.ts`: `analysis_runs.vision_analysis` 업데이트 +- [x] 기존 `marketing_reports.channel_data`에도 병행 쓰기 유지 - [ ] 검증: channel_snapshots에 채널별 행 생성 확인 ### Phase 4: Edge Function 전환 — generate-report -- [ ] `generate-report/index.ts`: `analysis_runs.report` 업데이트 -- [ ] `generate-report/index.ts`: `analysis_runs.status = 'complete'` -- [ ] `generate-report/index.ts`: `clinics.last_analyzed_at` 업데이트 +- [x] `generate-report/index.ts`: `analysis_runs.report` 업데이트 +- [x] `generate-report/index.ts`: `analysis_runs.status = 'complete'` +- [x] `generate-report/index.ts`: `clinics.last_analyzed_at` 업데이트 - [ ] `content_plans` 자동 생성 (transformPlan 로직 서버사이드 이동) -- [ ] 기존 `marketing_reports.report`에도 병행 쓰기 유지 +- [x] 기존 `marketing_reports.report`에도 병행 쓰기 유지 - [ ] 검증: analysis_runs.status = 'complete' + report JSONB 생성 확인 ### Phase 5: 성과 분석 루프 구현