run_migrations

Function run_migrations 

Source
pub async fn run_migrations(config: &Config) -> Result<()>
Expand description

Run all database migrations.

Creates all tables, indexes, and virtual tables required by Context Harness. Safe to call multiple times — all operations are idempotent.

§Tables Created

  • documents — normalized document storage
  • chunks — text segments with content hashes
  • checkpoints — incremental sync cursors
  • chunks_fts — FTS5 full-text search index
  • embeddings — embedding metadata (model, dims, staleness hash)
  • chunk_vectors — embedding vector BLOBs

§Errors

Returns an error if the database connection fails or any SQL statement cannot be executed.