From a9e9c01bd03ea794bc3d69fc6afbbede31602a1c Mon Sep 17 00:00:00 2001 From: Rolf Date: Wed, 18 Mar 2026 13:50:15 +0100 Subject: [PATCH] fixing migration issues --- instrumentation.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/instrumentation.ts b/instrumentation.ts index 104e02d..ff615de 100644 --- a/instrumentation.ts +++ b/instrumentation.ts @@ -1,5 +1,10 @@ export async function register() { if (process.env.NEXT_RUNTIME === 'nodejs') { + const fs = await import('fs') + const path = await import('path') + const journal = path.join(process.cwd(), 'lib/db/migrations/meta/_journal.json') + if (!fs.existsSync(journal)) return + const { migrate } = await import('drizzle-orm/postgres-js/migrator') const { db } = await import('@/lib/db') await migrate(db, { migrationsFolder: './lib/db/migrations' })