coffee-order

Tables (7)

cart_items

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • menu_id — BIGINT — Foreign key → menus.id — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

menus

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • price — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

order_items

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • menu_id — BIGINT — Foreign key → menus.id — NOT NULL
  • menu_name — VARCHAR(100) — NOT NULL
  • unit_price — BIGINT — NOT NULL
  • quantity — INT — NOT NULL
  • line_price — BIGINT — NOT NULL

orders

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • total_price — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

point_histories

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id
  • type — VARCHAR(10) — NOT NULL
  • amount — BIGINT — NOT NULL
  • balance_after — BIGINT — NOT NULL
  • created_at — DATETIME — NOT NULL

points

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • balance — BIGINT — NOT NULL
  • updated_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • created_at — DATETIME — NOT NULL