mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-03-24 04:01:09 +00:00
* disable prisma logs on prod * linting * keep const top level --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
16 lines
458 B
JavaScript
16 lines
458 B
JavaScript
const { PrismaClient } = require("@prisma/client");
|
|
|
|
// npx prisma introspect
|
|
// npx prisma generate
|
|
// npx prisma migrate dev --name init -> ensures that db is in sync with schema
|
|
// npx prisma migrate reset -> resets the db
|
|
|
|
const isProd = process.env.NODE_ENV === "production";
|
|
const logLevels = isProd
|
|
? ["error", "info", "warn"]
|
|
: ["query", "info", "warn", "error"];
|
|
const prisma = new PrismaClient({
|
|
log: logLevels,
|
|
});
|
|
|
|
module.exports = prisma;
|