capstone

Tables (6)

analysis_results

  • id — BIGSERIAL
  • analysis_run_id — BIGINT — Foreign key → analysis_runs.id — NOT NULL
  • result_json — JSONB — NOT NULL
  • summary_text — TEXT
  • created_at — TIMESTAMPTZ — NOT NULL

analysis_runs

  • id — BIGSERIAL
  • document_id — BIGINT — Foreign key → documents.id — NOT NULL
  • ocr_result_id — BIGINT — Foreign key → ocr_results.id
  • status — TEXT — NOT NULL
  • model_name — TEXT
  • model_version — TEXT
  • prompt_version — TEXT
  • input_hash — TEXT
  • error_message — TEXT
  • created_at — TIMESTAMPTZ — NOT NULL
  • started_at — TIMESTAMPTZ
  • finished_at — TIMESTAMPTZ

documents

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • title — VARCHAR(200)
  • storage_key — TEXT — NOT NULL
  • mime_type — TEXT — NOT NULL
  • file_size — BIGINT
  • checksum — TEXT
  • status — TEXT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

ocr_results

  • id — BIGSERIAL
  • document_id — BIGINT — Foreign key → documents.id — NOT NULL
  • ocr_data — JSONB — NOT NULL
  • full_content — TEXT
  • engine — VARCHAR(50)
  • status — TEXT — NOT NULL
  • attempt_no — INT — NOT NULL
  • is_latest — BOOLEAN — NOT NULL
  • error_message — TEXT
  • created_at — TIMESTAMPTZ — NOT NULL
  • finished_at — TIMESTAMPTZ

questions

  • id — BIGSERIAL
  • ocr_result_id — BIGINT — Foreign key → ocr_results.id — NOT NULL
  • question_no — INT — NOT NULL
  • type — TEXT — NOT NULL
  • body_data — JSONB — NOT NULL
  • choices — JSONB
  • answer — SMALLINT
  • explanation — TEXT
  • source_type — TEXT — NOT NULL
  • source_question_id — BIGINT — Foreign key → questions.id
  • created_at — TIMESTAMPTZ — NOT NULL

users

  • id — BIGSERIAL
  • username — VARCHAR(50) — NOT NULL
  • password_hash — TEXT — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL