diff --git a/.gitignore b/.gitignore index d9c3f15..cdd7623 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,4 @@ Dockerfile zzz/ credentials/service_account.json - -# Scheduler (separate repo) o2o-castad-scheduler/ \ No newline at end of file diff --git a/app/home/api/routers/v1/home.py b/app/home/api/routers/v1/home.py index 03fac5d..4ab81df 100644 --- a/app/home/api/routers/v1/home.py +++ b/app/home/api/routers/v1/home.py @@ -357,7 +357,6 @@ async def _crawling_logic( f"[crawling] Step 3 FAILED - GPT 마케팅 분석 중 오류: {e} ({step3_elapsed:.1f}ms)" ) logger.exception("[crawling] Step 3 상세 오류:") - # GPT 실패 시에도 크롤링 결과는 반환 marketing_analysis = None gpt_status = "failed" else: @@ -375,8 +374,6 @@ async def _crawling_logic( logger.info(f"[crawling] - Step 2 (정보가공): {step2_elapsed:.1f}ms") if "step3_elapsed" in locals(): logger.info(f"[crawling] - Step 3 (GPT 분석): {step3_elapsed:.1f}ms") - if "step3_3_elapsed" in locals(): - logger.info(f"[crawling] - GPT API 호출: {step3_3_elapsed:.1f}ms") return { "status": gpt_status if 'gpt_status' in locals() else "completed", diff --git a/app/home/models.py b/app/home/models.py index c372219..a7e55d5 100644 --- a/app/home/models.py +++ b/app/home/models.py @@ -289,10 +289,10 @@ class MarketingIntel(Base): comment="고유 식별자", ) - place_id: Mapped[str] = mapped_column( + place_id: Mapped[Optional[str]] = mapped_column( String(36), - nullable=False, - comment="매장 소스별 고유 식별자", + nullable=True, + comment="매장 소스별 고유 식별자 (네이버 크롤링 시 'nv{id}' 형식; 직접 입력 시 NULL)", ) intel_result : Mapped[dict[str, Any]] = mapped_column( diff --git a/docs/database-schema/migration_2026_05_28_marketing_place_id_nullable.sql b/docs/database-schema/migration_2026_05_28_marketing_place_id_nullable.sql new file mode 100644 index 0000000..5e926fa --- /dev/null +++ b/docs/database-schema/migration_2026_05_28_marketing_place_id_nullable.sql @@ -0,0 +1,8 @@ +-- ============================================================ +-- Migration: marketing.place_id NULL 허용 +-- Date: 2026-05-28 +-- Description: 업체명+주소 직접 입력으로 마케팅 분석 생성 시 +-- 네이버 place_id가 없으므로 NULL 허용으로 변경 +-- ============================================================ + +ALTER TABLE marketing MODIFY place_id VARCHAR(36) NULL COMMENT '매장 소스별 고유 식별자 (네이버 크롤링 시 nv{id} 형식; 직접 입력 시 NULL)';