Snow

Tables (12)

chunk

  • chunk_id — bigserial
  • section_id — bigint — Foreign key → section.section_id — NOT NULL
  • document_id — bigint — Foreign key → document.document_id — NOT NULL
  • chunk_order — int — NOT NULL
  • content — text — NOT NULL
  • source_start_index — int — NOT NULL
  • source_end_index — int — NOT NULL
  • source_indices — integer — NOT NULL
  • embedding — vector(1024)
  • created_at — timestamp — NOT NULL
  • deleted_at — timestamp

document

  • document_id — bigserial
  • notebook_id — bigint — Foreign key → notebook.notebook_id — NOT NULL
  • original_file_name — varchar
  • stored_file_name — varchar
  • file_type — varchar — NOT NULL
  • file_size — bigint
  • page_count — int
  • analysis_status — varchar — NOT NULL
  • summary_text — text
  • analysis_error_message — text
  • uploaded_at — timestamp
  • analysis_started_at — timestamp
  • analysis_finished_at — timestamp
  • deleted_at — timestamp

generated_quiz

  • quiz_id — bigserial
  • job_id — bigint — Foreign key → generation_job.job_id — NOT NULL
  • quiz_order — int
  • quiz_type — varchar
  • question_text — text
  • choices — text
  • answer — text
  • explanation — text
  • source_section_ids — bigint
  • created_at — timestamp
  • deleted_at — timestamp

generation_context

  • context_id — bigserial
  • job_id — bigint — Foreign key → generation_job.job_id — NOT NULL
  • section_id — bigint — Foreign key → section.section_id — NOT NULL
  • rank — int
  • similarity_score — decimal
  • created_at — timestamp

generation_job

  • job_id — bigserial
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • notebook_id — bigint — Foreign key → notebook.notebook_id — NOT NULL
  • prompt_template_id — bigint — Foreign key → prompt_template.prompt_template_id
  • scope_text — text
  • quiz_type — varchar — NOT NULL
  • difficulty — varchar — NOT NULL
  • quiz_count — int
  • result_count — int
  • status — varchar — NOT NULL
  • model_name — varchar
  • created_at — timestamp
  • started_at — timestamp
  • finished_at — timestamp
  • deleted_at — timestamp

notebook

  • notebook_id — bigserial
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • title — varchar — NOT NULL
  • is_default — boolean
  • created_at — timestamp
  • updated_at — timestamp
  • deleted_at — timestamp

notebook_qa_history

  • qa_history_id — bigserial
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • notebook_id — bigint — Foreign key → notebook.notebook_id — NOT NULL
  • user_question — text — NOT NULL
  • ai_answer — text — NOT NULL
  • answerable — boolean — NOT NULL
  • cited_section_ids — bigint
  • created_at — timestamp
  • deleted_at — timestamp

prompt_template

  • prompt_template_id — bigserial
  • prompt_version — varchar — NOT NULL
  • system_prompt — text
  • user_prompt_template — text
  • output_schema — text
  • is_active — boolean
  • created_at — timestamp

quiz_qa_history

  • qa_history_id — bigserial
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • quiz_id — bigint — Foreign key → generated_quiz.quiz_id — NOT NULL
  • user_question — text — NOT NULL
  • ai_answer — text — NOT NULL
  • answerable — boolean — NOT NULL
  • created_at — timestamp
  • deleted_at — timestamp

section

  • section_id — bigserial
  • document_id — bigint — Foreign key → document.document_id — NOT NULL
  • section_order — int — NOT NULL
  • heading — varchar
  • content — text — NOT NULL
  • source_start_index — int — NOT NULL
  • source_end_index — int — NOT NULL
  • source_indices — integer — NOT NULL
  • created_at — timestamp — NOT NULL
  • deleted_at — timestamp

source_unit

  • source_unit_id — bigserial
  • document_id — bigint — Foreign key → document.document_id — NOT NULL
  • unit_index — int — NOT NULL
  • source_type — varchar — NOT NULL
  • heading — varchar
  • content — text — NOT NULL
  • created_at — timestamp — NOT NULL

users

  • user_id — bigserial
  • email — varchar — NOT NULL
  • password_hash — varchar — NOT NULL
  • created_at — timestamp
  • deleted_at — timestamp