This commit is contained in:
Rizky 2024-01-25 14:21:42 +07:00
parent cb94533436
commit ab2b133d2e
1 changed files with 1 additions and 3 deletions

View File

@ -5,9 +5,7 @@ import { g } from "./global";
export const preparePrisma = async () => {
if (await existsAsync(dir("app/db/.env"))) {
if (!(await existsAsync(dir("node_modules/.prisma")))) {
await $({ cwd: dir(`app/db`) })`bun prisma generate`;
}
try {
const { PrismaClient } = await import("../../app/db/db");
g.db = new PrismaClient();