File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 - name : Copy schema to app and generate client
3737 working-directory : ./apps/app
3838 run : |
39- mkdir -p prisma
40- cp ../../packages/db/dist /schema.prisma prisma/ schema.prisma
41- bunx prisma generate
39+ mkdir -p prisma/schema
40+ find ../../packages/db/prisma /schema -name '* .prisma' ! -name ' schema.prisma' -exec cp {} prisma/schema/ \;
41+ bunx prisma generate --schema=prisma/schema
4242 - name : 🚀 Deploy Trigger.dev
4343 working-directory : ./apps/app
4444 timeout-minutes : 20
Original file line number Diff line number Diff line change 4242 - name : Copy schema to app and generate client
4343 working-directory : ./apps/app
4444 run : |
45- mkdir -p prisma
46- cp ../../packages/db/dist /schema.prisma prisma/ schema.prisma
47- bunx prisma generate
45+ mkdir -p prisma/schema
46+ find ../../packages/db/prisma /schema -name '* .prisma' ! -name ' schema.prisma' -exec cp {} prisma/schema/ \;
47+ bunx prisma generate --schema=prisma/schema
4848
4949 - name : 🚀 Deploy Trigger.dev
5050 working-directory : ./apps/app
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
66function createPrismaClient ( ) : PrismaClient {
77 const url = process . env . DATABASE_URL ! ;
88 const isLocalhost = / l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 | : : 1 / . test ( url ) ;
9- const adapter = new PrismaPg ( { connectionString : url , ssl : isLocalhost ? undefined : true } ) ;
9+ // Use verified SSL when NODE_EXTRA_CA_CERTS is set (Docker with RDS CA bundle),
10+ // otherwise fall back to unverified SSL (Trigger.dev, Vercel, other environments).
11+ const hasCABundle = ! ! process . env . NODE_EXTRA_CA_CERTS ;
12+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized : false } ;
13+ const adapter = new PrismaPg ( { connectionString : url , ssl } ) ;
1014 return new PrismaClient ( { adapter } ) ;
1115}
1216
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
66function createPrismaClient ( ) : PrismaClient {
77 const url = process . env . DATABASE_URL ! ;
88 const isLocalhost = / l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 | : : 1 / . test ( url ) ;
9- const adapter = new PrismaPg ( { connectionString : url , ssl : isLocalhost ? undefined : true } ) ;
9+ // Use verified SSL when NODE_EXTRA_CA_CERTS is set (Docker with RDS CA bundle),
10+ // otherwise fall back to unverified SSL (Trigger.dev, Vercel, other environments).
11+ const hasCABundle = ! ! process . env . NODE_EXTRA_CA_CERTS ;
12+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized : false } ;
13+ const adapter = new PrismaPg ( { connectionString : url , ssl } ) ;
1014 return new PrismaClient ( { adapter } ) ;
1115}
1216
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
66function createPrismaClient ( ) : PrismaClient {
77 const url = process . env . DATABASE_URL ! ;
88 const isLocalhost = / l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 | : : 1 / . test ( url ) ;
9- const adapter = new PrismaPg ( { connectionString : url , ssl : isLocalhost ? undefined : true } ) ;
9+ // Use verified SSL when NODE_EXTRA_CA_CERTS is set (Docker with RDS CA bundle),
10+ // otherwise fall back to unverified SSL (Trigger.dev, Vercel, other environments).
11+ const hasCABundle = ! ! process . env . NODE_EXTRA_CA_CERTS ;
12+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized : false } ;
13+ const adapter = new PrismaPg ( { connectionString : url , ssl } ) ;
1014 return new PrismaClient ( { adapter } ) ;
1115}
1216
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
66function createPrismaClient ( ) : PrismaClient {
77 const url = process . env . DATABASE_URL ! ;
88 const isLocalhost = / l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 | : : 1 / . test ( url ) ;
9- const adapter = new PrismaPg ( { connectionString : url , ssl : isLocalhost ? undefined : true } ) ;
9+ // Use verified SSL when NODE_EXTRA_CA_CERTS is set (Docker with RDS CA bundle),
10+ // otherwise fall back to unverified SSL (Trigger.dev, Vercel, other environments).
11+ const hasCABundle = ! ! process . env . NODE_EXTRA_CA_CERTS ;
12+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized : false } ;
13+ const adapter = new PrismaPg ( { connectionString : url , ssl } ) ;
1014 return new PrismaClient ( { adapter } ) ;
1115}
1216
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
5757function createPrismaClient(): PrismaClient {
5858 const url = process.env.DATABASE_URL!;
5959 const isLocalhost = /localhost|127\\.0\\.0\\.1|::1/.test(url);
60- const adapter = new PrismaPg({ connectionString: url, ssl: isLocalhost ? undefined : true });
60+ const hasCABundle = !!process.env.NODE_EXTRA_CA_CERTS;
61+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized: false };
62+ const adapter = new PrismaPg({ connectionString: url, ssl });
6163 return new PrismaClient({ adapter });
6264}
6365
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
66function createPrismaClient ( ) : PrismaClient {
77 const url = process . env . DATABASE_URL ! ;
88 const isLocalhost = / l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 | : : 1 / . test ( url ) ;
9- const adapter = new PrismaPg ( { connectionString : url , ssl : isLocalhost ? undefined : true } ) ;
9+ // Use verified SSL when NODE_EXTRA_CA_CERTS is set (Docker with RDS CA bundle),
10+ // otherwise fall back to unverified SSL (Trigger.dev, Vercel, other environments).
11+ const hasCABundle = ! ! process . env . NODE_EXTRA_CA_CERTS ;
12+ const ssl = isLocalhost ? undefined : hasCABundle ? true : { rejectUnauthorized : false } ;
13+ const adapter = new PrismaPg ( { connectionString : url , ssl } ) ;
1014 return new PrismaClient ( { adapter } ) ;
1115}
1216
You can’t perform that action at this time.
0 commit comments