Skip to content

Commit 5e0fb5f

Browse files
committed
prisma version error fixed
1 parent c1250a0 commit 5e0fb5f

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ EXPOSE 3000
1818

1919
# Run migrations and then start the application
2020
# `migrate deploy` is safe to run on every startup
21-
CMD ["sh", "-c", "npx prisma migrate deploy && npm run start"]
21+
CMD ["npm", "run", "start:prod"]

backend/prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ generator client {
1111

1212
datasource db {
1313
provider = "postgresql"
14-
url = env("DATABASE_URL")
14+
url = env("DATABASE_URL")
1515
1616
}
1717

backend/src/prisma/prisma.service.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
1+
import { Injectable, OnModuleDestroy } from '@nestjs/common';
22
import { PrismaClient } from '@prisma/client';
33

44
@Injectable()
5-
export class PrismaService
6-
extends PrismaClient
7-
implements OnModuleInit, OnModuleDestroy
8-
{
9-
async onModuleInit() {
10-
await this.$connect();
5+
export class PrismaService extends PrismaClient implements OnModuleDestroy {
6+
constructor() {
7+
super({
8+
datasources: {
9+
db: {
10+
url: process.env.DATABASE_URL,
11+
},
12+
},
13+
});
1114
}
15+
1216
async onModuleDestroy() {
1317
await this.$disconnect();
1418
}

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
redis:
53
image: redis:7-alpine

0 commit comments

Comments
 (0)