Skip to content

chore(backend): migrate Prisma to v7 with prisma.config and direct migration URL#3

Merged
BODMAT merged 6 commits into
masterfrom
chore/prisma7-config-direct-url
May 20, 2026
Merged

chore(backend): migrate Prisma to v7 with prisma.config and direct migration URL#3
BODMAT merged 6 commits into
masterfrom
chore/prisma7-config-direct-url

Conversation

@BODMAT

@BODMAT BODMAT commented May 20, 2026

Copy link
Copy Markdown
Owner

This PR upgrades backend Prisma integration to v7 and aligns configuration with the new Prisma 7 approach.

What changed

  • upgraded prisma and @prisma/client to v7
  • added @prisma/adapter-pg and pg
  • introduced apps/backend/prisma.config.ts
  • moved datasource URL handling out of schema.prisma
  • switched runtime Prisma client initialization to adapter-based connection (PrismaPg) in:
    • apps/backend/src/prisma.ts
    • apps/backend/prisma/seed.ts
  • added DIRECT_URL to backend env example for migration/direct DB connection
  • updated backend package configuration accordingly
  • normalized repo line endings and Prettier EOL policy

CI / test setup

  • exposed DIRECT_URL / DATABASE_URL to CI at the job level in .github/workflows/ci.yml so all steps (lint/build/tests) inherit them
  • removed the duplicate explicit prisma generate CI step — backend build script already runs it
  • declared DIRECT_URL / DATABASE_URL as globalPassThroughEnv in turbo.json so Turbo forwards them to tasks (Turbo otherwise strips env vars from task environments)
  • adapted Jest globalSetup to Prisma 7:
    • dropped the now-removed --skip-generate flag from prisma db push
    • set DIRECT_URL alongside DATABASE_URL for the testcontainers Postgres instance, since prisma.config.ts reads DIRECT_URL

Why

  • Prisma 7 deprecates/removes old datasource URL usage in schema-based workflow
  • this setup separates:
    • runtime pooled connection (DATABASE_URL)
    • migration/direct connection (DIRECT_URL)
  • reduces deploy issues with pgBouncer/pooler setups (e.g. Supabase + Render)

Notes

  • DATABASE_URL should point to pooled/runtime endpoint
  • DIRECT_URL should point to direct DB endpoint (typically :5432 + SSL)
  • no functional business-logic changes are intended in this PR

@BODMAT BODMAT merged commit edc4c01 into master May 20, 2026
1 check passed
@BODMAT BODMAT deleted the chore/prisma7-config-direct-url branch May 20, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant