Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

Skip the migration write when the schema is current

emanuele-emd94eb1d41260
diff --git a/src/store.rs b/src/store.rs
index a8fc420..9acf4b9 100644
--- a/src/store.rs
+++ b/src/store.rs
@@ -142,7 +142,17 @@ impl Store {
}
}
+ /// Brings the schema up to date. Writes nothing when it already is, so starting
+ /// `kanzo mcp` for every agent session costs no disk write.
pub fn migrate(&self) -> Result<()> {
+ let current = self
+ .conn
+ .query_row("SELECT value FROM meta WHERE key = 'schema_version'", [], |r| r.get::<_, String>(0))
+ .optional()
+ .unwrap_or(None);
+ if current == Some(MIGRATIONS.len().to_string()) {
+ return Ok(());
+ }
self.write(|c| {
c.execute("CREATE TABLE IF NOT EXISTS meta (key TEXT PRIMARY KEY, value TEXT NOT NULL)", [])?;
let version: usize = c