erd test

Tables (6)

cart_items

  • id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → members.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • quantity — INT — NOT NULL
  • price — DECIMAL(10,2) — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

members

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • phone_number — VARCHAR(20)
  • address — TEXT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

order_items

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • product_name — VARCHAR(255) — NOT NULL
  • product_description — TEXT — NOT NULL
  • product_price — DECIMAL(10,2) — NOT NULL
  • quantity — INT — NOT NULL
  • total_price — DECIMAL(10,2) — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

orders

  • id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → members.id — NOT NULL
  • order_number — VARCHAR(50) — NOT NULL
  • order_status — ENUM('PENDING', 'CONFIRMED', 'SHIPPED', 'DELIVERED', 'CANCELLED') — NOT NULL
  • total_amount — DECIMAL(10,2) — NOT NULL
  • delivery_address — TEXT — NOT NULL
  • delivery_phone — VARCHAR(20) — NOT NULL
  • delivery_name — VARCHAR(100) — NOT NULL
  • payment_method — ENUM('CARD', 'BANK_TRANSFER', 'KAKAO_PAY', 'NAVER_PAY') — NOT NULL
  • payment_status — ENUM('PENDING', 'COMPLETED', 'FAILED', 'CANCELLED') — NOT NULL
  • ordered_at — TIMESTAMP — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

product_category

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

products

  • id — BIGINT — Primary key — NOT NULL
  • category_id — BIGINT — Foreign key → product_category.id — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • description — TEXT — NOT NULL
  • price — DECIMAL(10,2) — NOT NULL
  • stock — INT — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP