모이고_ERD

테이블 (8)

Account (가상계좌) (Untitled2)

  • 계좌ID (accountId) — not null — 기본 키 — NOT NULL
  • 회원ID (userId) — Not Null — 외래 키 → User (사용자).회원ID — NOT NULL
  • 가용잔고 (balance) — not null
  • 초기자본금 (initial_balance) — not null
  • 계좌생성일시 (created_at) — not null
  • 수정일시 (update_at) — not null

AiAnalysis (AI 분석 결과) (Untitled5)

  • 분석ID (analysisId) — not null — 기본 키 — NOT NULL
  • 종목ID (stockId) — not null — 외래 키 → Stock (종목).종목ID — NOT NULL
  • Gemini 분석 내용 (gemini_result) — null
  • Claude 분석 내용 (claude_result) — null
  • Gemini 추천 (gemini_recommendation) — null
  • Claude 추천 (claude_recommendation) — null
  • AI 결과 일치 여부 (is_matched) — null
  • 투자심리 (sentiment) — null
  • 분석 시점 주가 (price_at_analysis) — null
  • 분석 실행일시 (analyzed_at) — not null

AiAnalysisNews (AI분석 - 뉴스 중간 테이블) (Untitled6)

  • 분석ID (analysisId) — not null — 외래 키 → AiAnalysis (AI 분석 결과).분석ID — NOT NULL
  • 종목ID (stockId) — not null — 외래 키 → AiAnalysis (AI 분석 결과).종목ID — NOT NULL

Holding (보유 종목) (Untitled8)

  • 보유ID (holdingId) — not null — 기본 키 — NOT NULL
  • 회원ID (userId) — Not Null — 외래 키 → User (사용자).회원ID — NOT NULL
  • 종목ID (stockId) — not null — 외래 키 → Stock (종목).종목ID — NOT NULL
  • 보유수량 (quantity) — not null
  • 평균매수가 (avg_price) — not null
  • 수정일시 (updated_at) — not null

News (뉴스) (Untitled4)

  • 뉴스ID (newId) — not null — 기본 키 — NOT NULL
  • 종목ID (stockId) — not null — 외래 키 → Stock (종목).종목ID — NOT NULL
  • 뉴스제목 (title) — not null
  • 뉴스요약 (summary) — null
  • 원문 URL (url) — not null
  • 뉴스 발행일시 (published_at) — not null
  • 수집일시 (collected_at) — not null
  • 출처매체 (source) — not null

Order (주문 내역) (Untitled7)

  • 주문ID (orderId) — not null — 기본 키 — NOT NULL
  • 회원ID (userId) — Not Null — 외래 키 → User (사용자).회원ID — NOT NULL
  • 종목ID (stockId) — not null — 외래 키 → Stock (종목).종목ID — NOT NULL
  • 주문유형 (order_type) — not null
  • 주문수량 (quantity) — not null
  • 체결가격 (price) — not null
  • 총거래금액 (total_amount) — not null
  • 주문체결일시 (ordered_at) — not null

Stock (종목) (Untitled3)

  • 종목ID (stockId) — not null — 기본 키 — NOT NULL
  • 종목코드 (StockCode) — not null — Unique Key
  • 종목명 (name) — not null
  • 시장구분 (market) — not null
  • 업종 (sector) — null
  • 등록일시 (created_at) — not null

User (사용자) (Untitled)

  • 회원ID (userId) — Not Null — 기본 키 — NOT NULL
  • 이메일 (email) — not null
  • 비밀번호 (password_hash) — not null
  • 닉네임 (nickname) — not null
  • 로그인 방식 (login_type) — not null
  • 소셜 ID (social_id) — null
  • 가입일시 (created_at) — not null
  • 수정일시 (update_at) — not null