montax

Tables (10)

oauth_accounts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • provider — VARCHAR(20) — NOT NULL — KAKAO | NAVER
  • provider_id — VARCHAR(255) — NOT NULL

order_items

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id
  • product_name — VARCHAR(255) — NOT NULL — 주문 시점 상품명 스냅샷
  • quantity — INT — NOT NULL
  • price — INT — NOT NULL — 주문 시점 단가 스냅샷

orders

  • id — BIGINT — Primary key — NOT NULL
  • order_number — VARCHAR(30) — NOT NULL — 예: 20250428-000001
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • status — VARCHAR(20) — NOT NULL — PENDING | PAID | SHIPPING | DELIVERED | CANCELLED
  • total_price — INT — NOT NULL
  • shipping_address — VARCHAR(500) — NOT NULL
  • created_at — DATETIME — NOT NULL

payments

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • payment_key — VARCHAR(255) — NOT NULL — PortOne 거래 고유번호
  • method — VARCHAR(30) — NOT NULL — CARD | KAKAO_PAY | NAVER_PAY | VIRTUAL_ACCOUNT
  • amount — INT — NOT NULL
  • status — VARCHAR(20) — NOT NULL — READY | PAID | CANCELLED | FAILED
  • paid_at — DATETIME
  • created_at — DATETIME — NOT NULL

posts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • answer — TEXT — 관리자 답변
  • answered_at — DATETIME
  • created_at — DATETIME — NOT NULL

product_images

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • sort_order — INT — NOT NULL

products

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • description — TEXT
  • price — INT — NOT NULL
  • stock — INT — NOT NULL
  • category — VARCHAR(50) — NOT NULL — BENCH_PAD | STRAP | WRIST_WRAP | CHALK
  • created_at — DATETIME — NOT NULL

review_images

  • id — BIGINT — Primary key — NOT NULL
  • review_id — BIGINT — Foreign key → reviews.id — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • sort_order — INT — NOT NULL

reviews

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL — 구매 인증용
  • content — TEXT — NOT NULL
  • rating — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255)
  • password — VARCHAR(255)
  • name — VARCHAR(100) — NOT NULL
  • role — VARCHAR(20) — NOT NULL
  • point — INT — NOT NULL
  • created_at — DATETIME — NOT NULL