Skip to content

Schema: research

Part of the generated database reference.

kb_documents

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
bot_id UUID no β€” FK bots.id
collection_name TEXT no β€” β€” β€”
file_path TEXT no β€” β€” β€”
file_size BIGINT no 0 β€” β€”
file_hash TEXT no β€” β€” β€”
first_published_at TIMESTAMPTZ no NOW() β€” β€”
last_modified_at TIMESTAMPTZ no NOW() β€” β€”
indexed_at TIMESTAMPTZ yes β€” β€” β€”
fail_count INTEGER no 0 β€” β€”
last_failed_at TIMESTAMPTZ yes β€” β€” β€”
metadata JSONB yes '{}'::jsonb β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: idx_unified_search_kb_documents(to_tsvector('english', COALESCE(file_path::text, '')

research_citations

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
source_id UUID no β€” FK research_sources.id
citation_style VARCHAR(255) no 'apa' β€” β€”
formatted_citation TEXT no β€” β€” β€”
bibtex TEXT yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”

research_collaborators

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
project_id UUID no β€” FK research_projects.id
user_id UUID no β€” β€” β€”
role VARCHAR(255) no 'viewer' β€” β€”
invited_by UUID yes β€” β€” β€”
joined_at TIMESTAMPTZ no NOW() β€” β€”

research_exports

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
project_id UUID no β€” FK research_projects.id
export_type VARCHAR(255) no β€” β€” β€”
format VARCHAR(255) no β€” β€” β€”
file_url TEXT yes β€” β€” β€”
file_size INTEGER yes β€” β€” β€”
status VARCHAR(255) no 'pending' β€” β€”
created_by UUID no β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
completed_at TIMESTAMPTZ yes β€” β€” β€”

research_findings

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
project_id UUID no β€” FK research_projects.id
title VARCHAR(255) no β€” β€” β€”
content TEXT no β€” β€” β€”
finding_type VARCHAR(255) no 'insight' β€” β€”
confidence_level VARCHAR(255) yes β€” β€” β€”
supporting_sources JSONB no '[]' β€” β€”
related_findings JSONB no '[]' β€” β€”
status VARCHAR(255) no 'draft' β€” β€”
created_by UUID no β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

research_notes

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
project_id UUID no β€” FK research_projects.id
source_id UUID yes β€” FK research_sources.id
title VARCHAR(255) yes β€” β€” β€”
content TEXT no β€” β€” β€”
note_type VARCHAR(255) no 'general' β€” β€”
tags VARCHAR(255) no '{}' β€” β€”
highlight_text TEXT yes β€” β€” β€”
highlight_position JSONB yes β€” β€” β€”
created_by UUID no β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

research_projects

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.23-branch-scope-cleanup
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
org_id UUID no β€” FK organizations.org_id
bot_id UUID no β€” β€” β€”
name VARCHAR(255) no β€” β€” β€”
description TEXT yes β€” β€” β€”
status VARCHAR(255) no 'active' β€” β€”
owner_id UUID no β€” β€” β€”
tags VARCHAR(255) no '{}' β€” β€”
settings JSONB no '{}' β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”
branch_id UUID yes β€” FK branches.id

research_sources

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
project_id UUID no β€” FK research_projects.id
source_type VARCHAR(255) no β€” β€” β€”
name VARCHAR(255) no β€” β€” β€”
url TEXT yes β€” β€” β€”
content TEXT yes β€” β€” β€”
summary TEXT yes β€” β€” β€”
metadata JSONB no '{}' β€” β€”
credibility_score INTEGER yes β€” β€” β€”
is_verified BOOLEAN no FALSE β€” β€”
added_by UUID no β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

user_kb_associations

  • Domain: research Β· Feature gate: #[cfg(feature = "research")] Β· Migration: 6.5.23-branch-scope-cleanup
  • Rust source: botschema/src/research.rs
Column SQL type Null Default Key References
id TEXT no β€” PK β€”
user_id TEXT no β€” β€” β€”
bot_id TEXT no β€” β€” β€”
kb_name TEXT no β€” β€” β€”
is_website INTEGER no 0 β€” β€”
website_url TEXT yes β€” β€” β€”
created_at TEXT no NOW() β€” β€”
updated_at TEXT no NOW() β€” β€”
branch_id UUID yes β€” FK branches.id