tenure

Tables (20)

addresses (배송지)

  • id — BIGINT — Primary key — NOT NULL — 배송지 식별자
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • receiver_name — VARCHAR(50) — NOT NULL — 수령인명
  • phone — VARCHAR(20) — NOT NULL — 연락처
  • zip_code — VARCHAR(10) — NOT NULL — 우편번호
  • address1 — VARCHAR(255) — NOT NULL — 주소
  • address2 — VARCHAR(255) — 상세주소
  • is_default — BOOLEAN — NOT NULL — 기본 배송지 여부

categories (카테고리)

  • id — BIGINT — Primary key — NOT NULL — 카테고리 식별자
  • parent_id — BIGINT — Foreign key → categories.id — 상위 카테고리 ID
  • name — VARCHAR(50) — NOT NULL — 카테고리명
  • depth — INT — NOT NULL — 깊이
  • sort_order — INT — NOT NULL — 노출 순서
  • is_active — BOOLEAN — NOT NULL — 필터 사용 여부

chat_messages (채팅 메세지)

  • id — BIGINT — Primary key — NOT NULL — 메시지 식별자
  • chat_room_id — BIGINT — Foreign key → chat_rooms.id — NOT NULL — chat_rooms.id
  • sender_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • message_type — ENUM('TEXT', 'IMAGE') — NOT NULL — TEXT, IMAGE
  • content — TEXT — 텍스트 내용
  • image_url — VARCHAR(500) — 이미지 URL
  • is_read — BOOLEAN — NOT NULL — 읽음 상태
  • created_at — DATETIME — NOT NULL — 생성일

chat_rooms (채팅방)

  • id — BIGINT — Primary key — NOT NULL — 채팅방 식별자
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — 아이템 단위 채팅
  • product_id — BIGINT — Foreign key → products.id — 판매 상품 문의 시
  • buyer_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • seller_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • last_message — VARCHAR(500) — 마지막 메세지
  • last_message_at — DATETIME — 마지막 메시지 시각
  • created_at — DATETIME — NOT NULL — 생성일

item_histories (아이템 히스토리)

  • id — BIGINT — Primary key — NOT NULL — 히스토리 식별자
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • previous_owner_id — BIGINT — Foreign key → users.id — users.id
  • current_owner_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • trade_id — BIGINT — Foreign key → trades.id — trades.id
  • ootd_id — BIGINT — Foreign key → ootds.id — ootds.id
  • history_type — VARCHAR(30) — NOT NULL — 히스토리 타입
  • history_description — VARCHAR(300) — 변경 설명
  • created_at — DATETIME — NOT NULL — 생성일

item_images (아이템 이미지)

  • id — BIGINT — Primary key — NOT NULL — 이미지 식별자
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • image_url — VARCHAR(500) — NOT NULL — 저장 이미지
  • is_thumbnail — BOOLEAN — NOT NULL — 대표 이미지 여부
  • sort_order — INT — NOT NULL — 이미지 순서

items (보유 아이템)

  • id — BIGINT — Primary key — NOT NULL — 아이템 식별자
  • owner_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • category_id — BIGINT — Foreign key → categories.id — NOT NULL — categories.id
  • name — VARCHAR(100) — NOT NULL — 아이템명
  • brand_name — VARCHAR(100) — 브랜드명
  • size — VARCHAR(30) — 사이즈
  • wear_count — INT — NOT NULL — 총 착용 횟수
  • last_worn_at — DATETIME — 최근 착용일
  • sale_status — ENUM('NOT_FOR_SALE', 'ON_SALE', 'SOLD') — NOT NULL — 판매 상태
  • allow_offer — BOOLEAN — NOT NULL — 구매 제안 허용
  • created_at — DATETIME — NOT NULL — 생성일
  • updated_at — DATETIME — NOT NULL — 수정일

notifications (알림)

  • id — BIGINT — Primary key — NOT NULL — 알림 식별자
  • receiver_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • notification_type — VARCHAR(30) — NOT NULL — 알림 타입
  • title — VARCHAR(100) — NOT NULL — 알림 제목
  • content — VARCHAR(500) — NOT NULL — 알림 내용
  • target_type — VARCHAR(30) — 연결 리소스 타입
  • target_id — BIGINT — 연결 리소스 ID
  • is_read — BOOLEAN — NOT NULL — 읽음 여부
  • created_at — DATETIME — NOT NULL — 생성일

ootd_images (ootd 이미지)

  • id — BIGINT — Primary key — NOT NULL — 이미지 식별자
  • ootd_id — BIGINT — Foreign key → ootds.id — NOT NULL — ootds.id
  • image_url — VARCHAR(500) — NOT NULL — OOTD 사진
  • is_thumbnail — BOOLEAN — NOT NULL — 대표 사진
  • sort_order — INT — NOT NULL — 사진 순서

ootd_item_tags (ootd 아이템 태그)

  • id — BIGINT — Primary key — NOT NULL — 이미지 식별자
  • ootd_id — BIGINT — Foreign key → ootds.id — NOT NULL — ootds.id
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • position_x — DECIMAL(5,2) — NOT NULL — X 좌표
  • position_y — DECIMAL(5,2) — NOT NULL — Y 좌표
  • tag_type — ENUM('AI', 'CONFIRMED') — NOT NULL — 태그 타입
  • tag_status — ENUM('PENDING', 'CONFIRMED', 'NEEDS_REVIEW') — NOT NULL — 태그 상태
  • created_at — DATETIME — NOT NULL — 생성일

ootd_reactions (ootd 반응)

  • id — BIGINT — Primary key — NOT NULL — 반응 식별자
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • ootd_id — BIGINT — Foreign key → ootds.id — NOT NULL — ootds.id
  • reaction_type — ENUM('LIKE', 'SAVE') — NOT NULL — 반응 타입
  • created_at — DATETIME — NOT NULL — 생성일

ootds (ootd 게시글)

  • id — BIGINT — Primary key — NOT NULL — 게시글 식별자
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • content — TEXT — 게시글 본문
  • is_public — BOOLEAN — NOT NULL — 공개 여부
  • ai_status — ENUM('PENDING', 'COMPLETED', 'FAILED') — NOT NULL — AI 분석 상태
  • like_count — INT — NOT NULL — 좋아요 수
  • save_count — INT — NOT NULL — 저장 수
  • created_at — DATETIME — NOT NULL — 생성일
  • updated_at — DATETIME — NOT NULL — 수정일

product_images (상품이미지)

  • id — BIGINT — Primary key — NOT NULL — 이미지 식별자
  • product_id — BIGINT — Foreign key → products.id — NOT NULL — products.id
  • image_url — VARCHAR(500) — NOT NULL — 상품 사진
  • is_thumbnail — BOOLEAN — NOT NULL — 대표 사진 여부
  • sort_order — INT — NOT NULL — 이미지 순서

products (판매상품)

  • id — BIGINT — Primary key — NOT NULL — 상품 식별자
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • seller_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • price — INT — NOT NULL — 판매가
  • shipping_fee — INT — NOT NULL — 배송비
  • fee_payer — ENUM('SELLER', 'BUYER', 'SPLIT') — NOT NULL — 수수료 부담
  • status — ENUM('ON_SALE', 'RESERVED', 'SOLD', 'HIDDEN') — NOT NULL — 상태
  • condition_note — VARCHAR(500) — 상태 설명
  • description — TEXT — 설명
  • created_at — DATETIME — NOT NULL — 생성일
  • updated_at — DATETIME — NOT NULL — 수정일

purchase_offers (구매 제안)

  • id — BIGINT — Primary key — NOT NULL — 제안 식별자
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • buyer_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • owner_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • offer_price — INT — NOT NULL — 구매 희망가
  • shipping_fee — INT — NOT NULL — 배송비
  • fee_payer — ENUM('SELLER', 'BUYER', 'SPLIT') — NOT NULL — 구매 제안자는 구매자 부담
  • status — ENUM('PENDING', 'ACCEPTED', 'REJECTED', 'CANCELED', 'EXPIRED') — NOT NULL — 상태
  • request_message — VARCHAR(500) — 구매자 요청 사항
  • created_at — DATETIME — NOT NULL — 생성일
  • responded_at — DATETIME — 수락/거절 시각

search_histories (최근 검색어)

  • id — BIGINT — Primary key — NOT NULL — 검색 이력 ID
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • keyword — VARCHAR(100) — NOT NULL — 최근 검색어
  • created_at — DATETIME — NOT NULL — 검색일

trades (거래)

  • id — BIGINT — Primary key — NOT NULL — 거래 식별자
  • product_id — BIGINT — Foreign key → products.id — 판매 상품 기반 거래
  • purchase_offer_id — BIGINT — Foreign key → purchase_offers.id — 구매 제안 기반 거래
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — 거래 아이템
  • seller_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • buyer_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • item_price — INT — NOT NULL — 상품가격
  • shipping_fee — INT — NOT NULL — 배송비
  • platform_fee — INT — NOT NULL — 거래 수수료
  • total_amount — INT — NOT NULL — 총액
  • settlement_amount — INT — NOT NULL — 판매자 정산액
  • status — ENUM('PAYMENT_COMPLETED', 'SHIPPING', 'DELIVERED', 'PURCHASE_CONFIRMED', 'SETTLED', 'CANCELED') — NOT NULL — 상태
  • shipping_address — VARCHAR(500) — NOT NULL — 배송지
  • delivery_request — VARCHAR(300) — 요청사항
  • created_at — DATETIME — NOT NULL — 생성일
  • updated_at — DATETIME — NOT NULL — 수정일

user_profiles (사용자 프로필)

  • id — BIGINT — Primary key — NOT NULL — 프로필 식별자
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • profile_image_url — VARCHAR(500)
  • height_cm — INT — 신체 정보
  • weight_kg — INT — 신체 정보
  • preferred_style — VARCHAR(100) — 선호 스타일
  • grade — ENUM('BASIC', 'ANCHOR') — NOT NULL — 사용자 등급
  • is_public — BOOLEAN — NOT NULL — 계정 공개 범위

users (사용자)

  • id — BIGINT — Primary key — NOT NULL — 사용자 식별자
  • email — VARCHAR(100) — NOT NULL — 로그인 이메일
  • password — VARCHAR(255) — NOT NULL — 암호화 저장
  • nickname — VARCHAR(30) — NOT NULL — 서비스 표시명
  • role — ENUM('USER', 'ADMIN') — NOT NULL — 역할
  • status — ENUM('ACTIVE', 'SUSPENDED', 'DELETED') — NOT NULL — 상태
  • created_at — DATETIME — NOT NULL — 가입일
  • updated_at — DATETIME — NOT NULL — 수정일

wishes (위시리스트)

  • id — BIGINT — Primary key — NOT NULL — 위시 식별자
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — users.id
  • item_id — BIGINT — Foreign key → items.id — NOT NULL — items.id
  • notification_enabled — BOOLEAN — NOT NULL — 판매 전환/가격 변동 알림
  • created_at — DATETIME — NOT NULL — 생성일