Skip to content

fix: 시드 밖 계정의 시드 상품 주문·리뷰가 재시드를 막음 #535

Closed

Description

@chanwoo7

증상

  • 시드 밖 계정(구매자 프론트로 로그인한 실제 테스트 계정 등)이 시드 매장 상품을 주문하거나 리뷰를 남기면, 다음 yarn prisma:seed 재실행이 시드 상품 삭제에서 실패합니다.
    • order_item.product_id·order_item.store_id·review.product_id·review.store_id FK가 모두 RESTRICT입니다.
    • resetSeedScope는 주문을 시드 사용자 기준(order.account_id in userIds)으로만 지우므로, 시드 밖 계정의 주문 품목과 리뷰가 남습니다.
  • 찜·최근 본 상품·매장 대화는 이미 상품·매장 기준으로도 정리하고 있어 해당하지 않습니다.

배경

정리 방향(제안)

  • 시드 매장(storeIds)의 주문 품목을 가진 주문을 계정과 무관하게 함께 정리하거나, 해당 주문 품목·리뷰(및 그 하위 댓글·신고·미디어)를 먼저 지웁니다.
  • #534의 src/test/seed-reset-scope.spec.ts에 "시드 밖 계정이 시드 상품을 주문·리뷰한 뒤 재시드" 케이스를 추가합니다.

Activity

  1. chanwoo7 commented on Oct 15, 2026

    @chanwoo7
    MemberAuthor

    #536으로 수정, 릴리즈 #537(257edb3)로 운영 반영.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔧 Fix디버깅 및 오류 해결

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions