Skip to content

infra(cody): saved_looks user-scoped 저장 테이블 + RLS (F9 분리) #635

Description

@thxforall

목적

코디 재현 엔진 (+)Saved / Shop-this-look(F9)가 의존하는 saved_looks user-scoped 저장 테이블 + FK를 생성한다. codex 리뷰에서 F9(frontend)에 섞여 있던 DB migration을 operating contract(type:infra + human checkpoint)에 따라 별도 infra 이슈로 분리한 것.

범위 / 화면

  • saved_looks 테이블: id, user_id(FK→auth.users), recommended_look_ref(저장 대상), slug(unique, nullable — 공유 전 NULL), title, created_at
  • RLS: user-scoped (own insert/select/delete) + 공유 slug는 public read
  • SeaORM migration (packages/api-server/migration/)

Acceptance Criteria

  • saved_looks 테이블 migration 작성 (packages/api-server/migration/)
  • user_id FK + RLS 정책 (own row insert/select/delete, 공유 slug public read)
  • slug unique constraint (공유 전까지 nullable)
  • cody_matches(stage2 §7.2 = 공용 서비스 캐시)와 명확히 구별 — saved_looks는 user-scoped 저장소
  • human checkpoint: 스키마 리뷰 후 DEV 적용 → 검증 → PRD (격리 환경 먼저)
  • F9(frontend)가 이 테이블 존재를 가정하고 동작하도록 contract 정렬

mock / real 경계

  • 이 이슈가 real 백엔드(DB)를 만든다. F9는 이 테이블이 생기기 전까지 mock/stub로 진행 가능.

의존성

  • blocks: F9 ((+)Saved 보드 영속화 — 단 F9는 mock으로 선행 가능)
  • 관련: cody-match-stage2 §7.2 (cody_matches 구별)

제약 · 주의

  • type:infra — DB 변경은 격리(DEV) 환경 먼저 테스트 후 human checkpoint 거쳐 PRD. (operating contract / project DB migration strategy: SeaORM=테이블·컬럼)
  • cody_matches를 consumer 저장소로 오용 금지 (공용 캐시).

참조

  • decoded-docs/Architecture/cody-match-stage2.md §7.2 (cody_matches 공용 캐시)
  • F9 — (+)Saved / Shop-this-look
  • DB migration strategy (SeaORM 테이블/컬럼 vs Supabase CLI RLS/함수)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend백엔드/APIcodyCody Recreation Engine MVPdata데이터/DBinfra

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions