mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
BREAKING: postgres + saas
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { PrismaClient } from "@prisma/client"
|
||||
import path from "path"
|
||||
|
||||
const globalForPrisma = globalThis as unknown as {
|
||||
prisma: PrismaClient | undefined
|
||||
@@ -8,10 +7,3 @@ const globalForPrisma = globalThis as unknown as {
|
||||
export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: ["query", "info", "warn", "error"] })
|
||||
|
||||
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma
|
||||
|
||||
export let DATABASE_FILE = process.env.DATABASE_URL?.replace("file:", "") ?? "db.sqlite"
|
||||
if (DATABASE_FILE?.startsWith("/")) {
|
||||
DATABASE_FILE = path.resolve(process.cwd(), DATABASE_FILE)
|
||||
} else {
|
||||
DATABASE_FILE = path.resolve(process.cwd(), "prisma", DATABASE_FILE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user