Skip to main content

run_pending_migrations

Function run_pending_migrations 

Source
pub fn run_pending_migrations(data_dir: &Path) -> Result<usize, String>
Expand description

Apply all pending migrations in-process before srv opens its stores.

Under the launcher, srv never calls this at boot: its gate exits 4 and the launcher runs migrate --prepare. A srv without a supervisor (headless, task dev:standalone) calls it from prepare_in_process before id_store binds to the shared store. Returns Ok(0) when nothing is pending.

Unlike run_migrate_command this writes progress via tracing rather than stdout JSON and is meant to be called from within the daemon process rather than a subprocess. Returns the number of migrations applied. On error, returns Err — callers should fall back to the per-channel store rather than binding id_store to an un-backfilled shared store.

data_dir must be the wave data dir (parent of db/), not the db dir.