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);