chore: migrate to PostgreSQL with Prisma

This commit is contained in:
AyrisAI
2026-05-14 14:57:15 +03:00
parent 2642d254dc
commit f328296c64
10 changed files with 253 additions and 61 deletions

15
lib/prisma.ts Normal file
View File

@@ -0,0 +1,15 @@
import { PrismaClient } from "@prisma/client";
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};
export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
// In Prisma 7, the connection URL should ideally come from prisma.config.ts
// or passed here if not using the new config system.
// For now, let's see if it picks up the URL automatically.
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;