From 400fd62cb830edee5c137fc6e8bd394ef7dc7ee5 Mon Sep 17 00:00:00 2001 From: Benoit de Chezelles Date: Sun, 5 Apr 2026 01:35:56 +0200 Subject: [PATCH] fix: DB migrating on every run when OPENCODE_CHANNEL is e.g. 'stable' --- packages/opencode/src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 1fa027abf904..c0f2681672d9 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -29,8 +29,6 @@ import { WebCommand } from "./cli/cmd/web" import { PrCommand } from "./cli/cmd/pr" import { SessionCommand } from "./cli/cmd/session" import { DbCommand } from "./cli/cmd/db" -import path from "path" -import { Global } from "./global" import { JsonMigration } from "./storage/json-migration" import { Database } from "./storage/db" import { errorMessage } from "./util/error" @@ -108,8 +106,8 @@ const cli = yargs(args) args: process.argv.slice(2), }) - const marker = path.join(Global.Path.data, "opencode.db") - if (!(await Filesystem.exists(marker))) { + // Use the database path as the marker to trigger migration if missing + if (!(await Filesystem.exists(Database.Path))) { const tty = process.stderr.isTTY process.stderr.write("Performing one time database migration, may take a few minutes..." + EOL) const width = 36