baemin

Tables (11)

CATEGORIES

  • id — bigint — Primary key — NOT NULL
  • restaurant_id — bigint — Foreign key → RESTAURANTS.restaurant_id — NOT NULL

COUPONS

  • coupon_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → USERS.user_id — NOT NULL
  • restaurant_id — bigint — Foreign key → RESTAURANTS.restaurant_id — NOT NULL
  • coupon_name — varchar(45)
  • discount — int
  • expired_date — timestamp
  • created_at — timestamp
  • is_used — bool

DELIVERS

  • deliver_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → USERS.user_id — NOT NULL
  • order_id — bigint — Foreign key → ORDERS.order_id — NOT NULL
  • item_id — bigint — Foreign key → ORDERS.item_id — NOT NULL
  • restaurant_id — bigint — Foreign key → ORDERS.restaurant_id — NOT NULL
  • payment_id — bigint — Foreign key → PAYMENTS.id — NOT NULL
  • ordered_at (time) — timestamp
  • deliver_type — varchar(255)
  • status — varchar(255)
  • estimated_time — timestamp
  • price — int
  • delivered_at — timestamp
  • driver_id — int

ITEMS

  • item_id — bigint — Primary key — NOT NULL
  • restaurant_id — bigint — Foreign key → RESTAURANTS.restaurant_id — NOT NULL
  • name — varchar(255)
  • description — text
  • price — int

ORDERS

  • order_id — bigint — Primary key — NOT NULL
  • item_id — bigint — Foreign key → ITEMS.item_id — NOT NULL
  • restaurant_id — bigint — Foreign key → ITEMS.restaurant_id — NOT NULL
  • count — int

PAYMENTS

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → USERS.user_id — NOT NULL

PRESENTS

  • present_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → USERS.user_id — NOT NULL
  • coupon_id — bigint — Foreign key → COUPONS.coupon_id — NOT NULL
  • user_id2 — int
  • created_at — timestamp

RESTAURANTS

  • restaurant_id — bigint — Primary key — NOT NULL
  • restaurant_no — int
  • name — varchar(255)
  • mininum_price (minimum_price) — int
  • deliver_price — int
  • open_time — timestamp
  • close_time — timestamp
  • address — varchar(255)
  • phone — varchar(20)
  • created_at — timestamp
  • updated_at (updated_att) — timestamp
  • status — varchar(10)

REVIEWS

  • review_id — int — Primary key — NOT NULL
  • deliver_id — int — Foreign key → DELIVERS.deliver_id — NOT NULL
  • user_id — int — Foreign key → DELIVERS.user_id — NOT NULL
  • order_id — int — Foreign key → DELIVERS.order_id — NOT NULL
  • item_id — int — Foreign key → DELIVERS.item_id — NOT NULL
  • restaurant_id — int — Foreign key → DELIVERS.restaurant_id — NOT NULL
  • id (id2) — int — Foreign key → DELIVERS.payment_id — NOT NULL
  • score — int
  • image — blob
  • description — text

USERS

  • user_id — bigint — Primary key — NOT NULL
  • user_no — bigint
  • name — varchar(45)
  • address — varchar(255)
  • level — varchar(10)
  • point — int
  • created_at — timestamp
  • updated_at — timestamp

WISHLISTS

  • wishlist_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → USERS.user_id — NOT NULL
  • restaurant_id — bigint — Foreign key → RESTAURANTS.restaurant_id — NOT NULL