Skip to main content

Migration

Type Alias Migration 

Source
pub type Migration = fn(Value) -> Result<Value, ProjectError>;
Expand description

One schema step: MIGRATIONS[i] turns a version i + 1 book.json into version i + 2. Each step is a plain function on JSON, written once and never changed afterwards (old files stay old). When the schema changes incompatibly: bump FORMAT_VERSION, append the step, and commit a fixture of the old version under tests/fixtures/.