쇼핑몰 프로젝트

테이블 (5)

category

  • category_id — BIGINT
  • name — VARCHAR(60) — NOT NULL
  • parent_id — BIGINT
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

order

  • order_id — BIGINT
  • user_id — BIGINT — NOT NULL
  • order_number — VARCHAR(40) — NOT NULL
  • order_status — ENUM('pending','paid','shipped','cancelled','refunded') — NOT NULL
  • order_total — DECIMAL(12,2) — NOT NULL
  • ordered_at — DATETIME — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — ix_order_user_date
  • INDEX — ix_order_status

order_item

  • order_item_id — BIGINT
  • order_id — BIGINT — NOT NULL
  • product_id — BIGINT — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — ix_oi_order
  • INDEX — ix_oi_product

product

  • product_id — BIGINT
  • seller_id — BIGINT
  • category_id — BIGINT — NOT NULL
  • name — VARCHAR(120) — NOT NULL
  • origin — VARCHAR(50)
  • weight_g — DECIMAL(7,2)
  • price — DECIMAL(12,2) — NOT NULL
  • stock_quantity — INT — NOT NULL
  • status — ENUM('active','hidden','soldout') — NOT NULL
  • thumbnail_url — VARCHAR(255)
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL
  • INDEX — ix_product_category_status
  • INDEX — ix_product_status

users

  • user_id — BIGINT
  • email — VARCHAR(100) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(20)
  • address — VARCHAR(255)
  • role — ENUM('buyer','seller','admin') — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL