e-commerce

Tables (18)

Cart

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

CartItem

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

Category

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Comment

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → Post.id — NOT NULL
  • author_id — BIGINT — Foreign key → User.id — NOT NULL
  • parent_comment_id — BIGINT — Foreign key → Comment.id
  • content — TEXT — NOT NULL
  • like_count — INT — NOT NULL
  • is_deleted — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Delivery

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → Order.id — NOT NULL
  • tracking_number — VARCHAR(100)
  • courier_company — VARCHAR(100)
  • status — VARCHAR(50) — NOT NULL
  • shipped_at — DATETIME
  • delivered_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Order

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → User.id — NOT NULL
  • order_number — VARCHAR(50) — NOT NULL
  • total_price — DECIMAL(12,2) — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • delivery_address — VARCHAR(500) — NOT NULL
  • delivery_phone — VARCHAR(20) — NOT NULL
  • delivery_memo — TEXT
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

OrderItem

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → Order.id — NOT NULL
  • product_id — BIGINT — Foreign key → Product.id — NOT NULL
  • product_name — VARCHAR(255) — NOT NULL
  • quantity — INT — NOT NULL
  • unit_price — DECIMAL(10,2) — NOT NULL
  • total_price — DECIMAL(12,2) — NOT NULL

Payment

  • id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → Order.id — NOT NULL
  • payment_method — VARCHAR(50) — NOT NULL
  • amount — DECIMAL(12,2) — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • transaction_id — VARCHAR(255)
  • paid_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Post

  • id — BIGINT — Primary key — NOT NULL
  • author_id — BIGINT — Foreign key → User.id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • view_count — INT — NOT NULL
  • like_count — INT — NOT NULL
  • comment_count — INT — NOT NULL
  • is_deleted — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

PostImage

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → Post.id — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • alt_text — VARCHAR(255)
  • display_order — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

PostLike

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → Post.id — NOT NULL
  • user_id — BIGINT — Foreign key → User.id — NOT NULL
  • created_at — DATETIME — NOT NULL

Product

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • description — TEXT
  • price — DECIMAL(10,2) — NOT NULL
  • stock_quantity — INT — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

ProductCategory

  • product_id — BIGINT — Foreign key → Product.id — NOT NULL
  • category_id — BIGINT — Foreign key → Category.id — NOT NULL

ProductImage

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → Product.id — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • alt_text — VARCHAR(255)
  • is_main — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL

Report

  • id — BIGINT — Primary key — NOT NULL
  • reporter_id — BIGINT — Foreign key → User.id — NOT NULL
  • target_type — VARCHAR(50) — NOT NULL
  • target_id — BIGINT — NOT NULL
  • reason — VARCHAR(100) — NOT NULL
  • description — TEXT
  • status — VARCHAR(50) — NOT NULL
  • admin_memo — TEXT
  • processed_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

SocialAccount

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → User.id — NOT NULL
  • provider — VARCHAR(50) — NOT NULL
  • provider_id — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

User

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255)
  • nickname — VARCHAR(100) — NOT NULL
  • phone_number — VARCHAR(20)
  • address — VARCHAR(500)
  • role — VARCHAR(50) — NOT NULL
  • is_deleted — BOOLEAN — NOT NULL
  • email_verified — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME

Wishlist

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → User.id — NOT NULL
  • product_id — BIGINT — Foreign key → Product.id — NOT NULL
  • created_at — DATETIME — NOT NULL