Skip to content

Commit

Permalink
feat: fix the prisma client in prod.
Browse files Browse the repository at this point in the history
  • Loading branch information
guangzhengli committed Jul 10, 2023
1 parent 0632e4e commit 8e09689
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { PrismaClient } from '@prisma/client'

declare global {
var prisma: PrismaClient | undefined
var prisma: PrismaClient
}

export const prisma =
global.prisma ||
new PrismaClient()

if (process.env.NODE_ENV !== 'production') global.prisma = prisma
global.prisma = prisma

0 comments on commit 8e09689

Please sign in to comment.