oldmarket

Tables (8)

account

  • id — BIGINT — Primary key
  • user_id — BIGINT — NOT NULL
  • balance — DECIMAL(10, 2)
  • created_at — TIMESTAMP
  • user_account (User_id) — BIGINT — Foreign key → user.id

blacklist

  • id — BIGINT — Primary key
  • user_id — BIGINT — NOT NULL
  • reason — TEXT — NOT NULL
  • reported_at — TIMESTAMP
  • is_active — BOOLEAN
  • report_id — BIGINT
  • admin_id — BIGINT — NOT NULL
  • user_blacklist (User_id) — BIGINT — Foreign key → user.id
  • blacklist_report (Report_id) — BIGINT — Foreign key → report.id

images (product_image)

  • id — BIGINT — Primary key
  • product_id — BIGINT — NOT NULL
  • image_url — VARCHAR(255) — NOT NULL
  • image_order — INT
  • product_productimg (Product_id) — BIGINT — Foreign key → product.id

product

  • id — BIGINT — Primary key
  • name — VARCHAR(255) — NOT NULL
  • price — DECIMAL(10, 2) — NOT NULL
  • content — TEXT
  • seller_id — BIGINT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • seller_product (Seller_id) — BIGINT — Foreign key → seller.id

report

  • id — BIGINT — Primary key
  • reporter_id — BIGINT — NOT NULL
  • reported_user_id — BIGINT — NOT NULL
  • reason — TEXT — NOT NULL
  • report_at — TIMESTAMP
  • status — boolean
  • user_reporter (Reporter_id) — BIGINT — Foreign key → user.id
  • user_reported (Reported_id) — BIGINT — Foreign key → user.id

seller

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

transaction

  • id — BIGINT — Primary key
  • buyer_id — BIGINT — NOT NULL
  • seller_id — BIGINT — NOT NULL
  • product_id — BIGINT
  • amount — DECIMAL(10, 2) — NOT NULL
  • is_successful — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • transaction_user (Buyer_id) — BIGINT — Foreign key → user.id
  • transaction_seller (Seller_id) — BIGINT — Foreign key → seller.id
  • product_transaction (Product_id) — BIGINT — Foreign key → product.id

user

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