baemin_practice

Tables (10)

address

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • detail — VARCHAR(255) — NOT NULL
  • latitude — DOUBLE
  • longitude — DOUBLE
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

menu

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • restaurant_id — BIGINT — Foreign key → restaurant.id
  • name — VARCHAR(100) — NOT NULL
  • price — DECIMAL(15,2) — NOT NULL
  • description — TEXT
  • is_sold_out — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

menu_option

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • name — VARCHAR(100)
  • extra_price — DECIMAL(15,2)
  • option_group_id — BIGINT — Foreign key → menu_option_group.id
  • created_at — TIMESTAMPT
  • updated_at — TIMESTAMPT

menu_option_group

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • name — VARCHAR(100)
  • option_type — ENUM('radio', 'check') — NOT NULL
  • is_required — BOOLEAN
  • menu_id — BIGINT — Foreign key → menu.id
  • created_at — TIMESTAMPT
  • updated_at — TIMESTAMPT

order

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • total_price — DECIMAL(15,2)
  • status — ENUM('ordered','preparing','delivering','completed','canceled')
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • address_id — BIGINT — Foreign key → address.id
  • user_id — BIGINT — Foreign key → user.id
  • restaurant_id — BIGINT — Foreign key → restaurant.id

order_item

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • quantity — INT — NOT NULL
  • item_price — DECIMAL(15,2) — NOT NULL
  • order_id — BIGINT — Foreign key → order.id
  • menu_id — BIGINT — Foreign key → menu.id
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

order_item_option

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • order_item_id — BIGINT — Foreign key → order_item.id
  • menu_option_id — BIGINT — Foreign key → menu_option.id
  • created_at — TIMESTAMPT
  • updated_at — TIMESTAMPT

restaurant

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • name — VARCHAR(100) — NOT NULL
  • category — VARCHAR(50) — NOT NULL
  • road_address — VARCHAR(255) — NOT NULL
  • latitude — DOUBLE — NOT NULL
  • longitude — DOUBLE — NOT NULL
  • minimum_order_price — DECIMAL(15,2) — NOT NULL
  • status — ENUM('active', 'inactive')
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

user

  • id — BIGINT — Primary key — AUTO_INCREMENT
  • name — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(20) — NOT NULL
  • email — VARCHAR(100)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

user_address

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → user.id
  • address_id — BIGINT — Foreign key → address.id
  • type — ENUM('집', '회사', '기타') — NOT NULL
  • is_default — BOOLEAN
  • UNIQUE(user_id, address_id)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP