Many changes.

This commit is contained in:
Daniel
2023-02-19 07:02:02 +03:30
parent d19204f4c0
commit e0f4c71eb2
19 changed files with 282 additions and 122 deletions
+11
View File
@@ -0,0 +1,11 @@
import { PrismaClient } from "@prisma/client";
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ["query"],
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;