Expand description
FathomDB schema — the versioned migration registry and bootstrap.
An internal leaf crate of the FathomDB workspace. It owns SCHEMA_VERSION,
the ordered MIGRATIONS table, and the routine that brings an on-disk
SQLite database up to the current version. fathomdb-engine calls it on the
open path; application code should depend on the fathomdb facade crate
instead and never invoke migration directly.
The on-disk sentinel is SQLite’s PRAGMA user_version. A migration step is
applied inside one BEGIN IMMEDIATE together with the version bump, so a
crash mid-step rolls back and the step re-runs whole.
⚠ Most steps are accretive, but not all are. Step 23 (TC-33) recreates
canonical_edges with INTEGER epoch-second temporal columns and does not
migrate the data: existing edge rows do not survive and no stored ISO-8601
value is converted. Nodes are unaffected. Anything that describes upgrading
an existing workspace must disclose this.
Structs§
- Migration
- Migration
Accretion Error - Migration
Failure Report - Migration
Logical IdPin Error - 0.8.20 Slice 25 (R-20-SUR) — rejection from the TC-11
logical_idpin. - Migration
Report - Migration
Step Report
Enums§
Constants§
- CANONICAL_
TABLES - Canonical tables owned by the rewrite-era schema, in stable display
order. Excludes FTS, vec0, and projection shadow tables (re-derivable
from canonical state) and internal
_fathomdb_*metadata. - JOURNAL_
SUFFIX - Suffix of the optional SQLite rollback journal file
(
<db-name>.sqlite-journal). - LOCK_
SUFFIX - Suffix of the sidecar lock file (
<db-name>.sqlite.lock). - MIGRATIONS
- PRAGMA_
USER_ VERSION - SQLite
PRAGMAname carrying the on-disk schema-version sentinel. - RESERVED_
WRITE_ CURSOR_ KEY _fathomdb_open_statekey under which step 23 reserved the pre-TC-33canonical_edgeswrite-cursor high-water mark.- SCHEMA_
VERSION - SQLITE_
SUFFIX - Suffix of the canonical SQLite database file (
<db-name>.sqlite). - WAL_
SUFFIX - Suffix of the SQLite write-ahead log file (
<db-name>.sqlite-wal).
Functions§
- bootstrap_
steps - check_
migration_ accretion - check_
migration_ logical_ id_ pin - 0.8.20 Slice 25 (R-20-SUR) — the TC-11 pin’s static migration guard, and
the sibling of
check_migration_accretion. - migrate
- migrate_
with_ event_ sink - migrate_
with_ steps