From fab927884c5c74ab8fa54d9e7ba53f6a80313d22 Mon Sep 17 00:00:00 2001 From: Arlind Date: Wed, 17 Jun 2026 12:54:22 +0200 Subject: [PATCH] fix(db): migrate.js honors BIFROST_DB_PATH So production migrations hit the same SQLite file the running app uses (src/lib/db.ts), instead of a repo-local bifrost.db. Mirrors the pattern already in seed-production.js and seed-roadmap.js. Falls back to the dev db when unset. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/migrate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/migrate.js b/scripts/migrate.js index 88c5211..d68188a 100644 --- a/scripts/migrate.js +++ b/scripts/migrate.js @@ -5,7 +5,9 @@ import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); -const dbPath = join(__dirname, '..', 'bifrost.db'); +// Honor BIFROST_DB_PATH in production so migrations hit the same file the +// running app uses (see src/lib/db.ts). Falls back to the repo-local dev db. +const dbPath = process.env.BIFROST_DB_PATH ?? join(__dirname, '..', 'bifrost.db'); const migrationsDir = join(__dirname, '..', 'migrations'); const db = new Database(dbPath);