From 46210ea954537aa58eee7ef603879f2e61cc38d8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:34:47 +0100 Subject: [PATCH] Refactoring --- apps/api/src/services/prisma/prisma.service.ts | 7 ++++--- prisma/seed.mts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/src/services/prisma/prisma.service.ts b/apps/api/src/services/prisma/prisma.service.ts index f380da0b0..cdbc1cdfd 100644 --- a/apps/api/src/services/prisma/prisma.service.ts +++ b/apps/api/src/services/prisma/prisma.service.ts @@ -15,6 +15,10 @@ export class PrismaService implements OnModuleInit, OnModuleDestroy { public constructor(configService: ConfigService) { + const adapter = new PrismaPg({ + connectionString: configService.get('DATABASE_URL') + }); + let customLogLevels: LogLevel[]; try { @@ -28,9 +32,6 @@ export class PrismaService ? [{ emit: 'stdout', level: 'query' }] : []; - const adapter = new PrismaPg({ - connectionString: configService.get('DATABASE_URL') - }); super({ adapter, log, diff --git a/prisma/seed.mts b/prisma/seed.mts index f12774500..4819e241e 100644 --- a/prisma/seed.mts +++ b/prisma/seed.mts @@ -4,6 +4,7 @@ import { PrismaClient } from '@prisma/client'; const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); + const prisma = new PrismaClient({ adapter }); async function main() {