fix(core): bump SCHEMA_VERSION so migrations 56-57 actually run

Migrations 56 (chat_sessions.cliSessionFile) and 57 (ai_sessions.archived)
were added without bumping SCHEMA_VERSION, so migrate() early-returned on
existing v55 DBs. The dashboard surfaced this as repeated 500s on
/api/ai-sessions: "no such column: archived". Add a guardrail test that
parses db.ts and asserts SCHEMA_VERSION matches the highest applyMigration
target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-01 11:13:05 -07:00
parent 99493481f9
commit 1d175e1ce3
2 changed files with 38 additions and 19 deletions

View File

@@ -86,7 +86,7 @@ export function probeFts5(db: DatabaseSync): boolean {
// ── Schema Definition ────────────────────────────────────────────────
const SCHEMA_VERSION = 55;
const SCHEMA_VERSION = 57;
function normalizeTaskComments(
steeringComments: SteeringComment[] | undefined,