market2

Tables (7)

accounts

  • id — BIGINT — Primary key
  • id_user (User_id) — BIGINT — Foreign key → users.id
  • user_id — BIGINT
  • balance — DECIMAL(15, 2)
  • created_at (Field) — TIMESTAMP

blacklist

  • id — BIGINT — Primary key
  • user_id — BIGINT — NOT NULL
  • reason — VARCHAR(255) — NOT NULL
  • reported_at — TIMESTAMP
  • is_active — BOOLEAN
  • admin_id — BIGINT

product_images

  • id — BIGINT — Primary key
  • id (id2) — BIGINT — Foreign key → products.id
  • product_id — BIGINT
  • image_url — VARCHAR(255) — NOT NULL

products

  • id — BIGINT — Primary key
  • seller_user (Seller_id) — BIGINT — Foreign key → sellers.seller_user
  • name — VARCHAR(100) — NOT NULL
  • price — DECIMAL(10, 2) — NOT NULL
  • content — varchar(500)

sellers

  • id — BIGINT — Primary key
  • seller_user (User_id) — BIGINT — Foreign key → users.id
  • sale_count — INT
  • rating — DECIMAL(3, 2)
  • user_id — Long

transactions

  • id — BIGINT — Primary key
  • Buyer_transactions (Buyer_id) — BIGINT — Foreign key → users.id
  • Seller_transactions (Seller_id) — BIGINT — Foreign key → sellers.seller_user
  • buyer_id — BIGINT
  • seller_id — BIGINT
  • amount — DECIMAL(10, 2) — NOT NULL
  • is_successful — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at

users

  • id — BIGINT — Primary key
  • username — VARCHAR(50) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • address — VARCHAR(255)
  • role — ENUM('ADMIN', 'USER')