init_db's own schema_meta write was ON CONFLICT DO NOTHING, and the daemon (Coordinator.setup) calls init_db, never migrate() — so on an existing ledger the column was ensured but schema_version was never advanced (observed live: kind column present, schema_meta stuck at 3). migrate() already upserts the version correctly but was effectively dead code (no production caller). init_db now ends by calling migrate(conn), which steps the version and runs any version-gated steps. Idempotent — re-running the create/ensure statements is harmless. Regression test: an existing v3-stamped DB run through init_db now reports schema_version == SCHEMA_VERSION (4) and has the kind column. 1491 passed. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| schema.py | ||
| schema.sql | ||
| transitions.py | ||