Upgrade to Prisma 7 with adapter pattern
Some checks failed
Build and Push Docker Image / lint-and-typecheck (push) Failing after 26s
Build and Push Docker Image / build (push) Has been skipped

- Update prisma and @prisma/client to ^7.0.0
- Add @prisma/adapter-pg for PostgreSQL connections
- Create prisma.config.ts for datasource configuration
- Remove url from schema.prisma datasource block
- Update prisma.ts to use PrismaPg adapter pattern

Breaking change in Prisma 7: datasource url now configured
via prisma.config.ts instead of schema.prisma

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 14:42:50 +01:00
parent 49e5f4c43f
commit 67bb4138f3
4 changed files with 22 additions and 4 deletions

12
prisma/prisma.config.ts Normal file
View File

@@ -0,0 +1,12 @@
import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
schema: 'prisma/schema.prisma',
migrations: {
path: 'prisma/migrations',
},
datasource: {
url: env('DATABASE_URL'),
},
})

View File

@@ -7,7 +7,7 @@ generator client {
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
// url configured in prisma.config.ts (Prisma 7+)
}
// ============================================================================