Netlify fix env vars and Deploy prisma #69
4 changed files with 21 additions and 5 deletions
1
.env
1
.env
|
|
@ -7,6 +7,7 @@ TWILIO_PHONE_NUMBER=
|
||||||
|
|
||||||
# PRISMA
|
# PRISMA
|
||||||
DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
|
DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
|
||||||
|
DIRECT_URL="postgres://hestia:test123@localhost:5432/hestia"
|
||||||
|
|
||||||
# CLERK
|
# CLERK
|
||||||
PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead
|
PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
[build]
|
[build]
|
||||||
command = "bun run build"
|
command = "bunx prisma migrate deploy && bun run build"
|
||||||
publish = "build"
|
publish = "build"
|
||||||
|
|
@ -12,6 +12,7 @@ generator pothos {
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
|
directUrl = env("DIRECT_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,17 @@
|
||||||
import { PrismaClient } from '@prisma/client';
|
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