hankki

Tables (10)

discount_items

  • id — BIGINT — Primary key — NOT NULL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • menu_id — BIGINT — Foreign key → menus.id — NOT NULL
  • original_price — INT — NOT NULL
  • discount_price — INT — NOT NULL
  • total_quantity — INT — NOT NULL
  • remaining_quantity — INT — NOT NULL
  • status — ENUM('ON_SALE', 'SOLD_OUT', 'HIDDEN', 'EXPIRED') — NOT NULL
  • meal_type — ENUM('DINE_IN', 'TAKEOUT', 'BOTH') — NOT NULL
  • deadline_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

menus

  • id — BIGINT — Primary key — NOT NULL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • original_price — INT — NOT NULL
  • image_url — VARCHAR(500)
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

order_items

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • discount_item_id — BIGINT — Foreign key → discount_items.id — NOT NULL
  • paid_price — INT — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

orders

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • order_number — VARCHAR(50) — NOT NULL
  • total_amount — INT — NOT NULL
  • status — ENUM('PENDING', 'CONFIRMED', 'CANCELLED', 'COMPLETED', 'NO_SHOW') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

payments

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • method — ENUM('CARD', 'KAKAO_PAY', 'NAVER_PAY', 'MOCK') — NOT NULL
  • amount — INT — NOT NULL
  • status — ENUM('REQUESTED', 'SUCCESS', 'FAILED', 'REFUNDED') — NOT NULL
  • paid_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

reviews

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • store_id — BIGINT — Foreign key → stores.id — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • rating — INT — NOT NULL
  • content — TEXT
  • owner_reply — TEXT
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

stores

  • id — BIGINT — Primary key — NOT NULL
  • owner_id — BIGINT — Foreign key → users.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • latitude — DECIMAL(10, 7) — NOT NULL
  • longitude — DECIMAL(10, 7) — NOT NULL
  • category — VARCHAR(50)
  • description — TEXT
  • business_hours — VARCHAR(100)
  • status — ENUM('OPEN', 'CLOSED', 'TEMPORARY_CLOSED') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(20)
  • role — ENUM('VISITOR', 'CUSTOMER', 'OWNER', 'ADMIN') — NOT NULL
  • trust_score — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

visit_logs

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • verified_by — BIGINT — Foreign key → users.id
  • status — ENUM('WAITING', 'COMPLETED', 'NO_SHOW') — NOT NULL
  • verified_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

wishlists

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