Skip to content
/ loom Public

Commit 09ea8d4

Browse files
ghuntleyclaude
andcommitted
Include migration 036 in run_migrations
The migration file was created but not registered in the run_migrations function, causing the key_prefix column to be missing at runtime. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fa8e3a7 commit 09ea8d4

File tree

1 file changed

+14
-1
lines changed
  • crates/loom-server/src/db

1 file changed

+14
-1
lines changed

crates/loom-server/src/db/mod.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use loom_server_db::{
2121
ThreadSearchHit, UserRepository,
2222
};
2323

24-
/// Run all database migrations (001-035).
24+
/// Run all database migrations (001-036).
2525
///
2626
/// # Arguments
2727
/// * `pool` - SQLite connection pool
@@ -398,6 +398,19 @@ pub async fn run_migrations(pool: &SqlitePool) -> Result<(), ServerError> {
398398
}
399399
}
400400

401+
let m36 = include_str!("../../migrations/036_crash_api_keys_key_prefix.sql");
402+
for stmt in m36.split(';').filter(|s| !s.trim().is_empty()) {
403+
if let Err(e) = sqlx::query(stmt).execute(pool).await {
404+
let msg = e.to_string();
405+
if !msg.contains("already exists")
406+
&& !msg.contains("duplicate column")
407+
&& !msg.contains("UNIQUE constraint failed")
408+
{
409+
return Err(e.into());
410+
}
411+
}
412+
}
413+
401414
tracing::debug!("database migrations complete");
402415
Ok(())
403416
}

0 commit comments

Comments
 (0)