CupangEats Clone(2)
테이블 (20)
가게이미지 (restaurant_img)
- 이미지아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 식당아이디 (restaurant_id) — bigint — 외래 키 → 식당.식당아이디
- 이미지 (img) — 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)
리뷰 (review)
- 리뷰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 회원아이디 (user_id) — bigint — 외래 키 → 회원.회원아이디 — NOT NULL
- 식당아이디 (restaurant_id) — bigint — 외래 키 → 식당.식당아이디
- 별점 (score) — float
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
메뉴 (menu)
- 메뉴아이디 (id) — bigint auto_incremnet — 기본 키 — NOT NULL
- 카트메뉴아이디 (id2) — bigint auto_increment — 외래 키 → 카트메뉴.카트메뉴아이디 — NOT NULL
- 카트아이디 (cart_id) — bigint — 외래 키 → 카트메뉴.카트아이디 — NOT NULL
- 회원아이디 (user_id) — bigint — 외래 키 → 카트메뉴.회원아이디 — NOT NULL
- 메뉴명 (name) — varchar(30)
- 메뉴설명 (desc) — varchar(50)
- 가격 (price) — int
- 생성날짜 (created_id) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_id) — timestamp DEFAULT current_timestamp
- 상태 (status)
메뉴옵션 (meu_option)
- 옵션아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 메뉴아이디 (id2) — bigint auto_incremnet — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
- 카트메뉴아이디 (id22) — bigint auto_increment — 외래 키 → 메뉴.카트메뉴아이디 — NOT NULL
- 카트아이디 (cart_id) — bigint — 외래 키 → 메뉴.카트아이디 — NOT NULL
- 회원아이디 (user_id) — bigint — 외래 키 → 메뉴.회원아이디 — NOT NULL
- 옵셩명 (name) — varchar(10)
- 가격 (price) — int
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
메뉴이미지 (menu_img)
- 이미지아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 메뉴아이디 (menu_id) — bigint — 외래 키 → 메뉴.메뉴아이디 — NOT NULL
- 카트메뉴아이디 (id2) — bigint auto_increment — 외래 키 → 메뉴.카트메뉴아이디 — NOT NULL
- 카트아이디 (cart_id) — bigint — 외래 키 → 메뉴.카트아이디 — NOT NULL
- 회원아이디 (user_id) — bigint — 외래 키 → 메뉴.회원아이디 — NOT NULL
- 이미지 (img) — text
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
메뉴카테고리 (menu_category)
- 메뉴카테고리아이디 (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)
- 카트메뉴아이디 (id2) — bigint auto_increment — 외래 키 → 메뉴.카트메뉴아이디 — NOT NULL
- 카트아이디 (cart_id) — bigint — 외래 키 → 메뉴.카트아이디 — NOT NULL
- 회원아이디 (user_id) — bigint — 외래 키 → 메뉴.회원아이디 — NOT NULL
식당 (restaurant)
- 식당아이디 (id) — bigint auto_increment — 기본 키
- 프랜차이점아이디 (franchise_id) — bigint — 외래 키 → 프렌차이점.프랜차이점아이디 — NOT NULL
- 상호명 (restaurant_name) — varchar(50)
- 주소1 (addr1) — varchar(50)
- 주소2 (addr2) — varchar(50)
- 전화번호 (phone_number) — varchar(50)
- 대표자명 (owner_name) — varchar(20)
- 사업자등록번호 (company_number) — varchar(50)
- 오픈시간 (opening_time) — time
- 종료시간 (closing_time) — time
- 배달비 (delivery_fee) — int
- 최소주문 (minimum_order) — int
- 매장소개 (restaurant_desc) — text
- 원산지정보 (origin_info) — text
- 영양성분정보 (nutrition_fact) — text
- 알레르기유발정보 (allergen_info) — text — NOT NULL
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status) — varchar(10) DEFAULT 'ACTIVE'
식당카테고리 (restaurant_category)
- 식당카테고리아이디 (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_mapping)
- 식당카테고리아이디 (restaurant_category_id) — int auto_increment — 외래 키 → 식당카테고리.식당카테고리아이디 — NOT NULL
- 식당아이디 (restaurant_id) — bigint auto_increment — 외래 키 → 식당.식당아이디
유저쿠폰 (user_coupons)
- 유저쿠폰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 쿠폰아이디 (coupon_id) — bigint — 외래 키 → 쿠폰.쿠폰아이디 — NOT NULL
- 발급날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
이벤트 (events)
- 이벤트아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 이벤트명 (name) — varchar(20)
- 이벤트설명 (desc) — text
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
주문 (order)
- 주문아이디 (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)
- 일회용여부 (need_ 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
즐겨찾기 (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
- 총가격 (total_price) — int
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 상태 (status)
카트메뉴 (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)
쿠폰 (coupons)
- 쿠폰아이디 (id) — bigint auto_increment — 기본 키 — NOT NULL
- 쿠폰이름 (name) — varchar(20)
- 할인금액 (discount) — int
- 최소주문금액 (min_price) — int
- 생성날짜 (created_at) — timestamp DEFAULT current_timestamp
- 수정날짜 (updated_at) — timestamp DEFAULT current_timestamp
- 만료날짜 (expired_at) — timestamp
- 프랜차이점아이디 (id2) — bigint auto_increment — 외래 키 → 프렌차이점.프랜차이점아이디 — 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