ICT_AI_ERD_vertorDB_edited_ver

Tables (12)

attempt_item (사용자의 문항별_풀이_로그 (문제별 상세 결과))

  • attempt_item_id (Key) — Primary key — NOT NULL
  • quiz_attempt_id (ID) — Foreign key → quiz_attempt.quiz_attempt_id — NOT NULL
  • question_bank_id (ID2) — Foreign key → question_banks.question_bank_id — NOT NULL
  • user_answer (사용자의 응답)
  • is_correct (채점 결과)
  • time_ms (해당 문항 풀이 시간)
  • created_at (Field)

chat_sessions (Q&A 세션 (최근대화기록))

  • chat_session_id (Key) — Primary key — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • subject_id (Key2) — Foreign key → subjects.subject_id — NOT NULL
  • title (Field)
  • created_at (Field2)

documents (자료(문서))

  • document_id (자료ID) — Primary key — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • title (제목)
  • source_type (Field) — ENUM('PDF', 'TEXT')
  • file_url (원본 파일 저장 경로)
  • status (단계 표시 (UI 로딩바/재시도)) — ENUM('uploaded', 'parsed', indexed')
  • created_at (업로드일)
  • subject_id (Key) — Foreign key → subjects.subject_id — NOT NULL

qa_turns (1개의 Q&A)

  • qa_turn_id (qa_turn ID) — Primary key — NOT NULL
  • question (Field)
  • answer (Field2)
  • has_answer (임계치 미만이면 false -> "자료에 없음")
  • citations (출처) — JSONB
  • model (사용 모델/버전)
  • created_at (Field3)
  • chat_session_id (Key) — Foreign key → chat_sessions.chat_session_id — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL

question_banks (생성된 문제 1개)

  • question_bank_id (ID) — Primary key — NOT NULL
  • qtype (Field) — ENUM('객관식', '단답형', '주관식')
  • difficulty (난이도) — ENUM('쉬움', '보통', '어려움')
  • stem (문제 지문)
  • optons (선택지)
  • correct_text (정답 (진짜 문제의 정답))
  • explanation (해설)
  • citations (출처) — JSONB
  • created_at (Field2)
  • quiz_id (Key) — Foreign key → quizzes.quiz_id — NOT NULL

quiz_attempt (한 사용자가 세트 한번 푼 기록 (결과의 상단 데이터원천))

  • quiz_attempt_id (ID) — Primary key — NOT NULL
  • started_at
  • finished_at (제출 시점)
  • correct_count (정답 개수)
  • accuracy (정답률)
  • grade (성적) — ENUM('A', ~ 'F')
  • created_at (Field2)
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL

quizzes ("문제 생성하기" 때 생기는 문제세트)

  • quiz_id (Key) — Primary key — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • subject_id (Key2) — Foreign key → subjects.subject_id — NOT NULL
  • title (Field)
  • requested_count (사용자가 선택한 문제개수)
  • difficulty (난이도) — ENUM('쉬움', '보통', '어려움')
  • type (유형) — JSONB
  • status (상태) — ENUM("creating", "ready", "error")
  • created_at (생성일)

subjects (과목/주제)

  • subject_id (Key) — Primary key — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • name (과목명) — ex. 정처기
  • created_at (Field)

summarys (요약)

  • summary_id (요약 ID) — Primary key — NOT NULL
  • type (Field) — ENUM('overall', 'traps', 'concept_areas', 'three_lines'
  • content_md (마크다운 그대로 렌더링)
  • model (사용 모델/버전)
  • created_at (Field2)
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • subject_id (Key) — Foreign key → subjects.subject_id — NOT NULL
  • topic (사용자가 프롬포트에 입력한 내용) — ex) "전체 시험 대비 요약"

users (사용자)

  • user_id (유저ID) — INT — Primary key — NOT NULL
  • email (이메일)
  • name (Field) — TEXT
  • created_at — TIMESTAMP

vector_docs (인덱스 <-> 문서 매핑/상태)

  • vector_doc_id (Key) — Primary key — NOT NULL
  • vector_index_id (Key2) — Foreign key → vector_indexes.vector_index_id — NOT NULL
  • document_id (자료ID) — Foreign key → documents.document_id — NOT NULL
  • chunk_count (Field)
  • status (Field2) — ENUM('queued', 'embedding', 'done', 'failed')
  • created_at (Field3)
  • updated_at (Field4)

vector_indexes (유저 x 과목별 물리 인덱스)

  • vector_index_id (Key) — Primary key — NOT NULL
  • user_id (유저ID) — INT — Foreign key → users.user_id — NOT NULL
  • subject_id (Key2) — Foreign key → subjects.subject_id — NOT NULL
  • provider (Field) — ENUM('chroma', 'faiss')
  • embedding_model (Field2)
  • collection_name (Field3) — 임베딩 벡터의 저장소 이름, Chroma 같은 벡터스토어 안에서 그 컬렉션을 식별하는 키
  • persist_dir (Field4) — ./chroma_u42_subj-jeongcheogi_a1b2c3d4
  • chunk_count (Field8)
  • doc_count (Field7)
  • created_at (Field5)
  • updated_at (Field6)