Skip to main content

baseline_cmd

Function baseline_cmd 

Source
pub fn baseline_cmd(
    version: &str,
    description: &str,
    reason: &str,
    app: Option<&str>,
    database: Option<&str>,
    workspace: Option<PathBuf>,
    node_id: Option<u32>,
    single_node_dev: bool,
) -> ExitCode
Expand description

djogi migrations baseline entry point. Establishes a baseline ledger row + snapshot for an existing database adopted under Djogi’s migration ledger. The schema already exists, so compose + apply cannot run against the populated database without a starting point; baseline projects the live catalog into a single baseline ledger row (no SQL runs against user tables) and persists the projected snapshot as the canonical baseline so future migrations diff against the real DB state. --reason is required and must be non-empty — it is recorded in the ledger row’s partial_apply_note for the audit trail. An empty reason is a refusal (exit 2) caught before any DB work. Exit codes: 0 success, 1 runtime error (config / pool / projection failure), 2 refusal (empty --reason, unresolvable database URL, duplicate version collision, snapshot-persist failure after ledger insert, session-pinning correctness failure, or below PG 18).