
* downgrade func * fix security hole lol * fix query conditions * - set to trial not free - auto create stripe customer if missing - fix production check * Extracts downgrade logic to script, fixes ts-node conflicts with prisma * Adds trialEndsAt field to users * Updates trial/downgrade logic * Typo * Legibility fixes * Update team-billing.ts * Legibility improvements Co-authored-by: Jamie <ijamespine@me.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
17 lines
319 B
TypeScript
17 lines
319 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
|
|
declare global {
|
|
var prisma: PrismaClient | undefined;
|
|
}
|
|
|
|
export const prisma =
|
|
globalThis.prisma ||
|
|
new PrismaClient({
|
|
log: ["query", "error", "warn"],
|
|
});
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
globalThis.prisma = prisma;
|
|
}
|
|
|
|
export default prisma;
|