CupangEats Clone

테이블 (26)

가게이미지 (restaurant_imgs)

  • 이미지아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint auto_increment — 외래 키 → 식당.식당아이디
  • 이미지 (img_url) — text
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

결제수단 (payments)

  • 결제수단아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
  • 카드번호 (card_num) — varchar(20)
  • 유효기간MM (card_month) — varchar(10)
  • 유효기간YY (card_year) — varchar(10)
  • cvc — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (statuss)
  • 은행이름 (bank_name) — varchar(10)

리뷰 (reviews)

  • 리뷰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 회원아이디 (user_id) — bigint auto_increment — 외래 키 → 회원.회원아이디 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint auto_increment — 외래 키 → 식당.식당아이디
  • 별점 (score) — float
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — status
  • 내용 (content) — text

리뷰이미지 (review_img)

  • 리뷰이미지아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 리뷰아이디 (review_id) — bigint — 외래 키 → 리뷰.리뷰아이디 — NOT NULL
  • 회원아이디 (user_id) — bigint — 외래 키 → 리뷰.회원아이디 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint — 외래 키 → 리뷰.식당아이디
  • 이미지url (img_url) — text

메뉴 (menus)

  • 메뉴아이디 (id) — bigint auto_incremnet — 기본 키 — NOT NULL
  • 메뉴명 (name) — varchar(30)
  • 메뉴설명 (desc) — varchar(50)
  • 가격 (price) — int
  • 생성날짜 (created_id) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_id) — timestamp DEFAULT current_timestamp
  • 상태 (status)

메뉴옵션 (meu_options)

  • 옵션아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 카테고리아이디 (menu_option_category_id) — bigint — 외래 키 → 메뉴옵션카테고리.카테고리아이디 — NOT NULL
  • (menu_id) — bigint — 외래 키 → 메뉴옵션카테고리.메뉴아이디 — NOT NULL
  • 옵셩명 (name) — varchar(10)
  • 가격 (price) — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — timestamp DEFAULT current_timestamp

메뉴옵션카테고리 (menu_option_categorys)

  • 카테고리아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 메뉴아이디 (menu_id) — bigint auto_incremnet — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
  • 카테고리명 (name) — varchar(10)
  • 필수여부 (is_required) — varchar(10)
  • 생성시간 (created_at) — timestamp DEFAULT current_timestamp
  • 수정시간 (updated_at) — timestamp DEFAULT current_timestamp

메뉴이미지 (menu_imgs)

  • 이미지아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 메뉴아이디 (menu_id) — bigint auto_incremnet — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
  • 이미지 (img_url) — text
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — timestamp DEFAULT current_timestamp

메뉴카테고리 (menu_categorys)

  • 메뉴카테고리아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 메뉴아이디 (menu_id) — bigint — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
  • 메뉴카테고리네임 (category_name) — varchar(20)
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

배달비 (delivery_fees)

  • 배달비아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 식당아이디 (restuarant_id) — bigint — 외래 키 → 식당.식당아이디
  • 최소주문가격 (min_price) — int
  • 최대주문가격 (max_price) — int
  • 배달비 (price) — int

식당 (restaurants)

  • 식당아이디 (id) — bigint auto_increment — 기본 키
  • 프랜차이점아이디 (franchise_id) — bigint — 외래 키 → 프렌차이점.프랜차이점아이디 — NOT NULL
  • 상호명 (restaurant_name) — varchar(50)
  • 주소 (address) — varchar(50)
  • 공지사항 (notice) — varchar(50)
  • 전화번호 (phone_number) — varchar(50)
  • 대표자명 (owner_name) — varchar(20)
  • 사업자등록번호 (company_number) — varchar(50)
  • 오픈시간 (opening_time) — time
  • 종료시간 (closing_time) — time
  • 최소주문 (minimum_price) — int
  • 매장소개 (restaurant_desc) — text
  • 원산지정보 (origin_info) — text
  • 영양성분정보 (nutrition_fact_info) — text
  • 알레르기유발정보 (allergen_info) — text — NOT NULL
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10) DEFAULT 'ACTIVE'

식당카테고리 (restaurant_categorys)

  • 식당카테고리아이디 (restaurant_id) — int auto_increment — 기본 키 — NOT NULL
  • 카테고리명 (category_name) — varchar(20)
  • 카테고리이미지 (category_img) — text
  • 생성시간 (created_at) — timestamp DEFAULT current_timestamp
  • 수정시간 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10)

식당카테고리매핑 (restau_category_mappings)

  • 식당카테고리아이디 (restaurant_category_id) — int auto_increment — 외래 키 → 식당카테고리.식당카테고리아이디 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint auto_increment — 외래 키 → 식당.식당아이디

유저쿠폰 (user_coupons)

  • 유저쿠폰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 쿠폰아이디 (coupon_id) — bigint auto_increment — 외래 키 → 쿠폰.쿠폰아이디 — NOT NULL
  • 발급날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

이벤트 (events)

  • 이벤트아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 프랜차이점아이디 (franchise_id) — bigint — 외래 키 → 프렌차이점.프랜차이점아이디 — NOT NULL
  • 이벤트명 (name) — varchar(20)
  • 이벤트설명 (desc) — text
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

주문 (orders)

  • 주문아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint — 외래 키 → 식당.식당아이디
  • 카트아이디 (cart_id) — bigint — 외래 키 → 카트.카트아이디 — NOT NULL
  • 주문총금액 (cnt_price) — int
  • 가게사장님에게 (to_owner) — varchar(20)
  • 일회용여부 (is_ plastic) — varchar(10)
  • 배달기사님에게 (to_deliever) — varchar(20)
  • 주문상태 (status) — varchar(10)
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updatd_at) — timestamp DEFAULT current_timestamp
  • 리뷰유무 (is_review) — varchar(10)
  • 쿠폰아이디 (cuopon_id) — bigint
  • 결제수단아이디 (payment_id) — bigint — 외래 키 → 결제수단.결제수단아이디 — NOT NULL

주문메뉴옵션 (order_menu_options)

  • 주문메뉴옵션아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 상세메뉴아이디 (order_menu_id) — bigint — 외래 키 → 주문상세메뉴.상세메뉴아이디 — NOT NULL
  • 상세아이디 (order_detail_id) — bigint — 외래 키 → 주문상세메뉴.상세아이디 — NOT NULL
  • 주문아이디 (order_id) — bigint — 외래 키 → 주문상세메뉴.주문아이디 — NOT NULL
  • 메뉴아이디 (menu_id) — bigint — 외래 키 → 주문상세메뉴.메뉴아이디 — NOT NULL
  • 카트아이디 (cart_id) — bigint — 외래 키 → 주문상세메뉴.카트아이디 — NOT NULL
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

주문상세 (order_details)

  • 상세아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 주문아이디 (order_id) — bigint auto_increment — 외래 키 → 주문.주문아이디 — NOT NULL
  • 카트아이디 (id2) — bigint auto_increment — 외래 키 → 주문.카트아이디 — NOT NULL
  • 수량 (amout) — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

주문상세메뉴 (order_menus)

  • 상세메뉴아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 상세아이디 (order_detail_id) — bigint — 외래 키 → 주문상세.상세아이디 — NOT NULL
  • 주문아이디 (order_id) — bigint — 외래 키 → 주문상세.주문아이디 — NOT NULL
  • 메뉴아이디 (menu_id) — bigint — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
  • 카트아이디 (cart_id) — bigint — 외래 키 → 주문상세.카트아이디 — NOT NULL
  • 수량 (amount) — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

즐겨찾기 (favorites)

  • 즐겨찾기아이디 (id) — int — 기본 키
  • 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
  • 식당아이디 (restaurant_id) — bigint unsigned
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10) DEFAULT 'ACTIVE'

카트 (carts)

  • 카트아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10)

카트메뉴 (cart_menus)

  • 카트메뉴아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 카트아이디 (cart_id) — bigint — 외래 키 → 카트.카트아이디 — NOT NULL
  • 회원아이디 (user_id) — bigint — 외래 키 → 카트.회원아이디 — NOT NULL
  • 수량 (quantity) — int
  • 가격 (price) — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — status

쿠폰 (coupons)

  • 쿠폰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 쿠폰이름 (name) — varcar(20)
  • 할인금액 (discount) — int
  • 최소주문금액 (min_price) — int
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 만료날짜 (expired_at) — timestamp
  • 프랜차이점아이디 (franchise_id) — bigint — 외래 키 → 프렌차이점.프랜차이점아이디 — NOT NULL

프렌차이점 (franchises)

  • 프랜차이점아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 프랜차이점명 (name) — varchar(20)
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status)

회원 (users)

  • 회원아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
  • 이메일 (email) — varchar(45)
  • 비밀번호 (password) — varchar(50)
  • 전화번호 (phone_number) — varchar(45)
  • 이름 (name) — varchar(20)
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10) DEFAULT 'ACTIVE'

회원주소 (user_addrs)

  • 주소아이디 (id) — bigint auto_increment — 기본 키
  • 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
  • 상세주소 (addr_detail) — text
  • 길안내 (addr_desc) — text
  • 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
  • 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
  • 상태 (status) — varchar(10) DEFAULT 'ACTIVE'
  • 기본배송지여부 (is_default) — boolean
  • 도로명주소 (street_address) — varchar(20)
  • 별칭 (alias) — varchar(10)