Browse Source

Refactoring

pull/6027/head
Thomas Kaul 4 days ago
parent
commit
46210ea954
  1. 7
      apps/api/src/services/prisma/prisma.service.ts
  2. 1
      prisma/seed.mts

7
apps/api/src/services/prisma/prisma.service.ts

@ -15,6 +15,10 @@ export class PrismaService
implements OnModuleInit, OnModuleDestroy implements OnModuleInit, OnModuleDestroy
{ {
public constructor(configService: ConfigService) { public constructor(configService: ConfigService) {
const adapter = new PrismaPg({
connectionString: configService.get<string>('DATABASE_URL')
});
let customLogLevels: LogLevel[]; let customLogLevels: LogLevel[];
try { try {
@ -28,9 +32,6 @@ export class PrismaService
? [{ emit: 'stdout', level: 'query' }] ? [{ emit: 'stdout', level: 'query' }]
: []; : [];
const adapter = new PrismaPg({
connectionString: configService.get<string>('DATABASE_URL')
});
super({ super({
adapter, adapter,
log, log,

1
prisma/seed.mts

@ -4,6 +4,7 @@ import { PrismaClient } from '@prisma/client';
const adapter = new PrismaPg({ const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL connectionString: process.env.DATABASE_URL
}); });
const prisma = new PrismaClient({ adapter }); const prisma = new PrismaClient({ adapter });
async function main() { async function main() {

Loading…
Cancel
Save