db만 구축했는데 안되면 되돌리셈

This commit is contained in:
2025-11-21 17:03:55 +09:00
parent 24f17b1dd1
commit 6a546b6fcd
17 changed files with 3499 additions and 3 deletions

14
src/lib/prisma.ts Normal file
View File

@@ -0,0 +1,14 @@
import { PrismaClient } from '@prisma/client';
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};
export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
});
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;