simbatda

Tables (9)

CartItem (장바구니)

  • id (PK) — int — Primary key — NOT NULL
  • user_id (FK -> User) — int — Foreign key → User.id — NOT NULL
  • product_id (FK -> Product ( 담은 상품)) — int — Foreign key → Product.id — NOT NULL
  • quantity (수량) — int
  • created_at (생성 시점) — DateTime

Category (카테고리)

  • id (PK) — int — Primary key — NOT NULL
  • name (예: 재료/중식/한식 등) — char

Product (상품)

  • id (PK) — int — Primary key — NOT NULL
  • seller_id (FK -> Seller) — int — Foreign key → Seller.id — NOT NULL
  • user_id (FK -> User) — int — Foreign key → Seller.user_id — NOT NULL
  • category_id (FK -> Category) — int — Foreign key → Category.id — NOT NULL
  • name (상품 이름) — char
  • description (상품 설명) — text
  • price (원가) — int
  • discount_price (할인 가격) — int
  • discount_rate (할인율) — int
  • stock (재고 수량) — int
  • expiration_date (유통기한) — DateTime
  • is_active (판매 중/중단 여부) — boolean
  • created_at (등록일) — DateTime
  • updated_at (업데이트 일) — DateTime

Reservation (예약 (상점 단위))

  • id (PK) — int — Primary key — NOT NULL
  • user_id (FK -> User) — int — Foreign key → User.id — NOT NULL
  • status (예약 상태) — choices
  • created_at (예약 요청 시간) — DateTime
  • reserved_at (예약 확정 시간) — DateTime

ReservationItem (예약 (상품))

  • id (PK) — int — Primary key — NOT NULL
  • product_id (FK -> Product) — int — Foreign key → Product.id — NOT NULL
  • reservation_id (FK -> Reservation) — int — Foreign key → Reservation.id — NOT NULL
  • id (PK3) — int — Foreign key → Product.category_id — NOT NULL
  • quantity (수량) — int

Seller (판매자)

  • id (PK) — int — Primary key — NOT NULL
  • user_id (FK -> User) — int — Foreign key → User.id — NOT NULL
  • category_id (FK -> Category) — int — Foreign key → Category.id — NOT NULL
  • name (상점 이름) — char
  • opening_hour (영업시간 (줄글 형식)) — text
  • description (상점 설명) — text
  • address (주소 ( 위치 기반 지도)) — char
  • latitude (위도) — decimal
  • longitude (경도) — decimal
  • business_license (사업자 등록증) — file
  • permit_doc (영업 신고증) — file
  • bank_copy (통장 사본) — file

User (유저)

  • id (PK) — int — Primary key — NOT NULL
  • email (이메일) — email
  • password (비밀번호) — char
  • nickname (닉네임) — char
  • phone (전화번호) — char
  • is_seller (판매자 여부 구분) — boolean
  • created_at (가입일) — DateTime

UserRecommendedKeyword (추천 키워드)

  • id (PK) — int — Primary key — NOT NULL
  • user_id (FK->User) — int — Foreign key → User.id — NOT NULL
  • keyword (키워드) — char
  • score (추천 점수 or 가중치) — float
  • updated_at (업데이트 시간) — DateTime

WishList (찜하기)

  • id (PK) — int — Primary key — NOT NULL
  • user_id (FK -> User) — int — Foreign key → User.id — NOT NULL
  • product_id (FK -> Product) — int — Foreign key → Product.id — NOT NULL
  • id (PK3) — int — Foreign key → Product.category_id — NOT NULL