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