yound_and_rich

Tables (9)

bookmarks

  • bookmark_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • website_id — BIGINT — NOT NULL
  • created_at — DATETIME

comments

  • comment_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • website_id — BIGINT — NOT NULL
  • parent_comment_id — BIGINT — Foreign key → comments.parent_comment_id
  • content — TEXT — NOT NULL
  • is_deleted — BOOLEAN
  • created_at — DATETIME
  • updated_at — DATETIME

stock

  • stock_code — VARCHAR(20) — Primary key
  • company_name — VARCHAR(100)
  • market_type — VARCHAR(20)
  • market_cap — BIGINT

trade_history

  • id — BIGINT — Primary key
  • user_id — BIGINT — Foreign key → user.id
  • stock_code — VARCHAR(20) — Foreign key → stock.stock_code
  • trade_type — ENUM('BUY', 'SELL') — NOT NULL
  • quantity — INT
  • trade_price — BIGINT
  • trade_time — DATETIME

user

  • id — BIGINT — Primary key
  • kakao_email — VARCHAR(100) — NOT NULL
  • nickname — VARCHAR(50)
  • created_at — DATETIME

user_asset

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.id
  • total_asset — BIGINT
  • available_cash — BIGINT
  • invested_amount — BIGINT
  • last_updated — DATETIME

user_stock

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.id
  • stock_code — VARCHAR(20) — Foreign key → stock.stock_code
  • quantity — INT
  • average_price — BIGINT
  • total_value — BIGINT
  • profit_loss — BIGINT

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255)
  • nickname — VARCHAR(50) — NOT NULL
  • role — VARCHAR(20)
  • profile_image — VARCHAR(500)
  • refresh_token — VARCHAR(255)
  • provider — VARCHAR(20)
  • provider_id — VARCHAR(255)
  • created_at — DATETIME

websites

  • website_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • url — VARCHAR(500) — NOT NULL
  • description — TEXT
  • logo_url — VARCHAR(500)
  • category — VARCHAR(50)
  • view_count — BIGINT
  • bookmark_count — BIGINT
  • comment_count — BIGINT
  • status — VARCHAR(20)
  • created_at — DATETIME
  • updated_at — DATETIME