전자상거래

테이블 (12)

admin_review (Untitled)

  • admin_review_id — BIGINT — 기본 키 — NOT NULL
  • title — VARCHAR(100)
  • content — VARCHAR(500)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • is_deleted — TINYINT(1)
  • user_id — BIGINT — 외래 키 → user.user_id — NOT NULL — PK: user identifier
  • review_id — BIGINT — 외래 키 → review.review_id — NOT NULL

cart

  • cart_id — BIGINT — 기본 키 — NOT NULL — Quantity in cart
  • created_at — TIMESTAMP — NOT NULL — Created timestamp
  • updated_at — TIMESTAMP — Last updated timestamp
  • is_deleted — TINYINT(1) — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • user_id — BIGINT — 외래 키 → user.user_id — NOT NULL — PK: user identifier

cart_item

  • quantity — INT — NOT NULL — Ordered quantity
  • created_at — TIMESTAMP — NOT NULL — Created timestamp
  • updated_at — TIMESTAMP — Last updated timestamp
  • is_deleted — TINYINT(1) — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • product_id — BIGINT — 외래 키 → product.product_id — NOT NULL — Color option
  • cart_id — BIGINT — 외래 키 → cart.cart_id — NOT NULL — Quantity in cart

category

  • category_id — BIGINT — 기본 키 — NOT NULL — Category name
  • name — VARCHAR(30) — NOT NULL — Created timestamp
  • parent_category_id — BIGINT — PK: product identifier
  • created_at — TIMESTAMP — NOT NULL — Last updated timestamp
  • updated_at — TIMESTAMP — Soft delete flag (0: active, 1: deleted)
  • is_deleted — TINYINT(1) — NOT NULL — Parent category ID (for hierarchy)

discount

  • discount_id — BIGINT — 기본 키 — NOT NULL — Review content
  • discount_value — INT — NOT NULL — Created timestamp
  • discount_type — INT — NOT NULL — 할인 정액, 정률
  • product_id — BIGINT — 외래 키 → product.product_id — NOT NULL — Color option
  • created_at — TIMESTAMP — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • updated_at — TIMESTAMP — FK: author user ID
  • is_deleted — TINYINT(1) — NOT NULL — FK: order item that was reviewed

order_product

  • order_product_id — BIGINT — 기본 키 — NOT NULL — Discount value (% for rate, amount for fixed)
  • quantity — INT — NOT NULL — Discount type (e.g. AMOUNT, PERCENT)
  • created_at — TIMESTAMP — NOT NULL — Created timestamp
  • updated_at — TIMESTAMP — Last updated timestamp
  • is_deleted — TINYINT(1) — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • order_id — BIGINT — 외래 키 → orders.order_id — NOT NULL — Receiver full address
  • product_id — BIGINT — 외래 키 → product.product_id — NOT NULL — Color option

orders

  • order_id — BIGINT — 기본 키 — NOT NULL — Receiver full address
  • receiver_name — VARCHAR(30) — NOT NULL — Order status (e.g. CREATED / PAID / SHIPPED / COMPLETED / CANCELED)
  • receiver_phone — VARCHAR(11) — NOT NULL — Order date-time
  • receiver_address — VARCHAR(100) — NOT NULL — Delivery completed date-time
  • status — VARCHAR(15) — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • ordered_at — DATETIME — NOT NULL — Created timestamp
  • delivered_at — DATETIME — Last updated timestamp
  • is_deleted — TINYINT(1) — NOT NULL — FK: user who placed the order
  • created_at — TIMESTAMP — NOT NULL — PK: payment type identifier
  • updated_at — TIMESTAMP — Payment type name (e.g. CARD / ACCOUNT / POINT)
  • user_id — BIGINT — 외래 키 → user.user_id — NOT NULL — PK: user identifier

payment

  • payment_id — BIGINT — 기본 키 — NOT NULL — Created timestamp
  • total_amount — INT — NOT NULL — Last updated timestamp
  • discount_amount — INT — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • delivery_fee — INT — NOT NULL — FK: order ID
  • final_amount — INT — NOT NULL — FK: payment type ID
  • payment_status — VARCHAR(255)
  • created_at — TIMESTAMP — NOT NULL — PK: cart identifier
  • updated_at — TIMESTAMP — Created timestamp
  • is_deleted — TINYINT(1) — NOT NULL — Last updated timestamp
  • payment_type — VARCHAR(100)
  • order_id (order_id2) — BIGINT — 외래 키 → orders.order_id — NOT NULL — Receiver full address

product

  • product_id — BIGINT — 기본 키 — NOT NULL — Color option
  • name — VARCHAR(256) — NOT NULL — Unit price (KRW)
  • color — VARCHAR(100) — Current stock quantity
  • price — INT — NOT NULL — Product status (e.g. ON_SALE / SOLD_OUT)
  • stock — SMALLINT — NOT NULL — Product detailed description
  • status — VARCHAR(15) — NOT NULL — Created timestamp
  • description — MEDIUMTEXT — NOT NULL — Last updated timestamp
  • created_at — TIMESTAMP — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • updated_at — TIMESTAMP — FK: category ID
  • is_deleted — TINYINT(1) — NOT NULL — PK: order identifier
  • category_id — BIGINT — 외래 키 → category.category_id — NOT NULL — Category name

review

  • review_id — BIGINT — 기본 키 — NOT NULL
  • title — VARCHAR(100) — NOT NULL — PK: shipping address identifier
  • content — VARCHAR(500) — NOT NULL — Full shipping address (max 100 chars)
  • created_at — TIMESTAMP — NOT NULL — Default address flag (0: no, 1: yes)
  • updated_at — TIMESTAMP — FK: owner user ID
  • is_deleted — TINYINT(1) — NOT NULL
  • order_product_id — BIGINT — 외래 키 → order_product.order_product_id — NOT NULL — Discount value (% for rate, amount for fixed)
  • user_id — BIGINT — 외래 키 → user.user_id — NOT NULL — PK: user identifier

review_like

  • review_like_id — BIGINT — 기본 키 — NOT NULL
  • review_like_type (Field) — TINYINT(1) — 좋아요:1/싫어요:2
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • is_deleted — TINYINT(1)
  • user_id — BIGINT — 외래 키 → user.user_id — NOT NULL — PK: user identifier
  • review_id — BIGINT — 외래 키 → review.review_id — NOT NULL

user

  • user_id — BIGINT — 기본 키 — NOT NULL — PK: user identifier
  • portal_id — VARCHAR(30) — NOT NULL — Login ID (portal ID)
  • user_uuid — BINARY(16) — NOT NULL — User key (UUID)
  • password — VARCHAR(256) — NOT NULL — Encrypted password (e.g. BCrypt)
  • name — VARCHAR(100) — NOT NULL — User name
  • email — VARCHAR(30) — NOT NULL — Email address
  • phone_number — VARCHAR(11) — NOT NULL — Mobile phone number (digits only)
  • gender — VARCHAR(10) — NOT NULL — Gender
  • birth — DATE — Date of birth
  • role — VARCHAR(30) — NOT NULL — Role (e.g. USER / ADMIN)
  • status — VARCHAR(20) — NOT NULL — 회원 상태 (ACTIVE / INACTIVE / DELETED)
  • is_deleted — TINYINT(1) — NOT NULL — Soft delete flag (0: active, 1: deleted)
  • created_at — TIMESTAMP — NOT NULL — Created timestamp
  • updated_at — TIMESTAMP — Last updated timestamp