Lion2weeks

Tables (10)

bookmark

  • bookmark_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.user_id — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL

cart

  • cart_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.user_id — NOT NULL

cart_item

  • cart_item_id — BIGINT — Primary key — NOT NULL
  • cart_id — BIGINT — Foreign key → cart.cart_id — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • quantity — INT — NOT NULL

category

  • category_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL

comment

  • comment_id — BIGINT — Primary key — NOT NULL
  • review_id — BIGINT — Foreign key → review.review_id — NOT NULL
  • user_id — BIGINT — Foreign key → user.user_id — NOT NULL
  • content — VARCHAR(500) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • likes — INT

order

  • order_id — BIGINT — Primary key — NOT NULL
  • order_number — VARCHAR(50) — NOT NULL
  • user_id — BIGINT — Foreign key → user.user_id — NOT NULL
  • order_date — DATE — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • total_amount — DECIMAL(10,2)
  • delivery_fee — DECIMAL(10,2)
  • discount — DECIMAL(10,2)

order_item

  • order_item_id — BIGINT — Primary key — NOT NULL
  • order_id — BIGINT — Foreign key → order.order_id — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • quantity — INT — NOT NULL
  • price — DECIMAL(10,2) — NOT NULL

product

  • product_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • price — DECIMAL(10,2) — NOT NULL
  • description — TEXT
  • image — VARCHAR(500)
  • stock — INT
  • avg_rating — DECIMAL(2,1)
  • review_count — INT
  • category_id — BIGINT — Foreign key → category.category_id

review

  • review_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.user_id — NOT NULL
  • product_id — BIGINT — Foreign key → product.product_id — NOT NULL
  • rating — DECIMAL(2,1) — NOT NULL
  • content — TEXT
  • created_at — DATETIME — NOT NULL

user

  • user_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • profile_image — VARCHAR(500)