mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
Fix DATABASE_URL handling - prevent undefined error
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -47,7 +47,8 @@ const createIntegrationPrisma = (): PrismaClient => {
|
|||||||
|
|
||||||
const createProductionPrisma = (): PrismaClient => {
|
const createProductionPrisma = (): PrismaClient => {
|
||||||
// Use the database file from env or default location
|
// Use the database file from env or default location
|
||||||
const dbPath = process.env.DATABASE_URL?.replace('file:', '') || '../../prisma/prisma/dev.db'
|
const databaseUrl = process.env.DATABASE_URL || 'file:../../prisma/prisma/dev.db'
|
||||||
|
const dbPath = databaseUrl.replace('file:', '')
|
||||||
const db = new Database(dbPath)
|
const db = new Database(dbPath)
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||||
const adapter = new PrismaBetterSqlite3(db)
|
const adapter = new PrismaBetterSqlite3(db)
|
||||||
|
|||||||
Reference in New Issue
Block a user