Netlify fix env vars and Deploy prisma (#69)
* add logs * info * lol * direct url
This commit is contained in:
parent
7891c0b4b7
commit
8006d523c7
4 changed files with 21 additions and 5 deletions
1
.env
1
.env
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[build]
|
||||
command = "bun run build"
|
||||
command = "bunx prisma migrate deploy && bun run build"
|
||||
publish = "build"
|
||||
|
|
@ -12,6 +12,7 @@ generator pothos {
|
|||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
directUrl = env("DIRECT_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue