Skip to main content

SCHEMA_USER_VERSION

Constant SCHEMA_USER_VERSION 

Source
pub const SCHEMA_USER_VERSION: i64 = 50;
Expand description

Canonical value of PRAGMA user_version written after migrations.

Why 50 instead of CURRENT_SCHEMA_VERSION (15)? user_version is a 32-bit integer that SQLite reserves for application use. We deliberately set it to a project-specific marker (50 = decimal) so external inspection tools (sqlite3 db.sqlite "PRAGMA user_version", the file command, SQLite browser GUIs) can distinguish a sqlite-graphrag database from a generic SQLite file at a glance. The application-level schema version (15, matching CURRENT_SCHEMA_VERSION) is stored in the schema_meta table and exposed via health --json/stats --json. Bumping migrations does NOT change this constant. Refinery uses its own refinery_schema_history table for migration bookkeeping.