Netlify fix env vars and Deploy prisma (#69)

* add logs

* info

* lol

* direct url
This commit is contained in:
Baobeld 2025-01-26 19:48:26 -05:00 committed by GitHub
parent 7891c0b4b7
commit 8006d523c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 5 deletions

1
.env
View file

@ -7,6 +7,7 @@ TWILIO_PHONE_NUMBER=
# PRISMA
DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
DIRECT_URL="postgres://hestia:test123@localhost:5432/hestia"
# CLERK
PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead

View file

@ -1,3 +1,3 @@
[build]
command = "bun run build"
command = "bunx prisma migrate deploy && bun run build"
publish = "build"

View file

@ -12,6 +12,7 @@ generator pothos {
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
model User {

View file

@ -1,3 +1,17 @@
import { PrismaClient } from '@prisma/client';
import { logger } from '../logger';
export const prisma = new PrismaClient();
export const prisma = new PrismaClient({
log: [
{ emit: 'event', level: 'query' },
{ emit: 'event', level: 'info' },
],
});
prisma.$on('query', (event) => {
logger.debug(`Query [${event.duration}ms]: ${event.query}`);
});
prisma.$on('info', (event) => {
logger.info(event.message);
});