다우커머스과제

테이블 (8)

orders (주문)

  • id (아이디) — 기본 키 — NOT NULL
  • order_number (주문번호)
  • user_id (주문자)
  • total_price (주문가격)
  • created_at (생성일)

orders_additional_product (주문추가상품)

  • id (아이디) — 기본 키 — NOT NULL
  • order_product_id (주문상품아이디) — 외래 키 → orders_product.id — NOT NULL
  • name (추가상품이름)
  • unit_price (가격)
  • quantity (수량)
  • created_at (생성일)

orders_product (주문상품)

  • id (아이디) — 기본 키 — NOT NULL
  • order_id (주문아이디) — 외래 키 → orders.id — NOT NULL
  • product_id (상품아이디) — 외래 키 → product.id — NOT NULL
  • product_name (상품이름)
  • quantity (주문수량)
  • unit_price (상품가격)
  • total_price (주문상품가격)
  • created_at (생성일)

orders_product_option (주문상품옵션)

  • id (아이디) — 기본 키 — NOT NULL
  • order_product_id (주문상품아이디) — 외래 키 → orders_product.id — NOT NULL
  • option_name (옵션이름)
  • option_value (옵션값)
  • price_diff (가격증감)
  • created_at (생성일)

product (상품)

  • id (아이디) — 기본 키 — NOT NULL
  • name (상품이름)
  • price (가격)
  • description (상세설명)
  • created_at (생성일)
  • updated_at (수정일)

product_additional (추가상품)

  • id (아아디) — 기본 키 — NOT NULL
  • product_id (상품아이디) — 외래 키 → product.id — NOT NULL
  • name (추가상품이름)
  • price (가격)
  • created_at (생성일)
  • updated_at (수정일)

product_option (상품옵션)

  • id (아이디) — 기본 키 — NOT NULL
  • product_id (상품아이디) — 외래 키 → product.id — NOT NULL
  • name (상품옵션이름)
  • created_at (생성일)
  • updated_at (수정일)

product_option_value (상품옵션값)

  • id (아이디) — 기본 키 — NOT NULL
  • product_option_id (상품옵션아이디) — 외래 키 → product_option.id — NOT NULL
  • name (상품옵션값이름)
  • price_diff (가격증감)
  • created_at (생성일)
  • updated_at (수정일)