FluxMall

Tables (13)

cart_items

  • id — BIGINT — Primary key
  • cart_id — BIGINT — Foreign key → carts.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — DATETIME
  • updated_at — DATETIME

carts

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

categories

  • id — BIGINT — Primary key
  • parent_id — BIGINT — Foreign key → categories.id
  • name — VARCHAR(100) — NOT NULL
  • depth — INT — NOT NULL
  • is_active — BOOLEAN
  • created_at — DATETIME
  • updated_at — DATETIME

order_items

  • id — BIGINT
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • product_name — VARCHAR(255) — NOT NULL
  • quantity — INT — NOT NULL
  • unit_price — DECIMAL(10,2) — NOT NULL
  • discount_price — DECIMAL(10,2)
  • total_price — DECIMAL(12,2) — NOT NULL
  • created_at — DATETIME

orders

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • order_number — VARCHAR(50) — NOT NULL
  • orderer_name — VARCHAR(100) — NOT NULL
  • orderer_phone — VARCHAR(20) — NOT NULL
  • recipient_name — VARCHAR(100) — NOT NULL
  • recipient_phone — VARCHAR(20) — NOT NULL
  • zip_code — VARCHAR(10) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • address_detail — VARCHAR(255) — NOT NULL
  • shipping_message — VARCHAR(255)
  • delivery_message — VARCHAR(255)
  • total_product_amount — DECIMAL(12,2) — NOT NULL
  • discount_amount — DECIMAL(12,2)
  • shipping_fee — DECIMAL(10,2)
  • payment_amount — DECIMAL(12,2) — NOT NULL
  • status — ENUM('PENDING', 'PAID', 'PREPARING', 'SHIPPING', 'DELIVERED', 'CONFIRMED', 'CANCELLED') — NOT NULL
  • tracking_number — VARCHAR(100)
  • shipped_at — DATETIME
  • delivered_at — DATETIME
  • confirmed_at — DATETIME
  • cancelled_at — DATETIME
  • created_at — DATETIME
  • updated_at — DATETIME

payments

  • id — BIGINT — Primary key
  • order_id — BIGINT — Foreign key → orders.id — NOT NULL
  • payment_method — ENUM('CARD', 'KAKAO_PAY', 'NAVER_PAY', 'TOSS_PAY', 'VIRTUAL_ACCOUNT') — NOT NULL
  • payment_gateway — VARCHAR(50) — NOT NULL
  • transaction_id — VARCHAR(100) — NOT NULL
  • amount — DECIMAL(12,2) — NOT NULL
  • status — ENUM('PENDING', 'COMPLETED', 'FAILED', 'CANCELLED', 'REFUNDED') — NOT NULL
  • approved_at — DATETIME
  • cancelled_at — DATETIME
  • failure_reason — VARCHAR(255)
  • created_at — DATETIME
  • updated_at — DATETIME

product_images

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

products

  • id — BIGINT — Primary key
  • category_id — BIGINT — Foreign key → categories.id — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • description — TEXT
  • price — DECIMAL(10,2) — NOT NULL
  • discount_price — DECIMAL(10,2)
  • discount_rate — DECIMAL(5,2)
  • stock — INT
  • is_display — BOOLEAN
  • is_sold_out — BOOLEAN
  • view_count — INT
  • sales_count — INT
  • review_count — INT
  • review_average — DECIMAL(3,2)
  • created_at — DATETIME
  • updated_at — DATETIME

reviews

  • id — BIGINT
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • order_item_id — BIGINT — Foreign key → order_items.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • rating — INT — NOT NULL
  • content — TEXT — NOT NULL
  • images — JSON
  • is_photo_review — BOOLEAN
  • is_visible — BOOLEAN
  • helpful_count — INT
  • created_at — DATETIME
  • updated_at — DATETIME
  • deleted_at — DATETIME

social_accounts

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • provider — ENUM('KAKAO', 'NAVER', 'GOOGLE', 'APPLE') — NOT NULL
  • provider_id — VARCHAR(255) — NOT NULL
  • email — VARCHAR(255)
  • name — VARCHAR(100)
  • profile_image — VARCHAR(500)
  • created_at — DATETIME

user_addresses

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(20) — NOT NULL
  • zip_code — VARCHAR(10) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • address_detail — VARCHAR(255) — NOT NULL
  • is_default — BOOLEAN
  • created_at — DATETIME
  • updated_at — DATETIME

users

  • id — BIGINT — Primary key
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255)
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(20)
  • birthday — DATE
  • gender — ENUM('M', 'F', NULL)
  • role — ENUM('USER', 'ADMIN')
  • status — ENUM('ACTIVE', 'DORMANT', 'WITHDRAWN')
  • last_login_at — DATETIME
  • created_at — DATETIME
  • updated_at — DATETIME
  • deleted_at — DATETIME

wishlists

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • created_at — DATETIME