Update schema.prisma#4201
Conversation
|
@riccardoq76 is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds
Confidence Score: 3/5Not safe to merge without ensuring DIRECT_DATABASE_URL is documented and available across all environments. The directUrl addition introduces a mandatory new env var that will break any environment (CI, staging, self-hosted) that doesn't define DIRECT_DATABASE_URL. This is a P1 deployment-breaking issue. The indentation regression is minor (P2), but the env var concern alone warrants blocking the merge until the rollout plan is confirmed. prisma/schema.prisma — the new directUrl env reference needs coordination across all deployment environments. Important Files Changed
Sequence DiagramsequenceDiagram
participant App
participant PrismaClient
participant Pooler as Connection Pooler (url)
participant DB as PostgreSQL (directUrl)
App->>PrismaClient: Query / Mutation
PrismaClient->>Pooler: Runtime queries via DATABASE_URL
Pooler->>DB: Forwarded queries
App->>PrismaClient: prisma migrate / prisma generate
PrismaClient->>DB: Direct connection via DIRECT_DATABASE_URL
DB-->>PrismaClient: Schema introspection / migration result
Reviews (1): Last reviewed commit: "Update schema.prisma" | Re-trigger Greptile |
| relationMode = "prisma" | ||
| provider = "postgresql" | ||
| url = env("DATABASE_URL") | ||
| directUrl = env("DIRECT_DATABASE_URL") |
There was a problem hiding this comment.
Missing env var breaks all environments without
DIRECT_DATABASE_URL
When directUrl is declared in schema.prisma pointing to env("DIRECT_DATABASE_URL"), Prisma requires that environment variable to be present at both client-generation time (prisma generate) and at runtime. Any existing deployment — CI, staging, self-hosted installs — that doesn't define DIRECT_DATABASE_URL will fail with a Prisma validation error immediately after upgrading. The env var and its purpose (e.g., a non-pooled connection URL for migrations) should be documented and added to all environment configs before this change lands.
| datasource db { | ||
| provider = "postgresql" | ||
| url = env("DATABASE_URL") | ||
| relationMode = "prisma" | ||
| provider = "postgresql" | ||
| url = env("DATABASE_URL") | ||
| directUrl = env("DIRECT_DATABASE_URL") | ||
| relationMode = "prisma" | ||
| } |
There was a problem hiding this comment.
The
datasource db block fields lost their 2-space indentation, making them inconsistent with the generator client block above and the rest of the file.
| datasource db { | |
| provider = "postgresql" | |
| url = env("DATABASE_URL") | |
| relationMode = "prisma" | |
| provider = "postgresql" | |
| url = env("DATABASE_URL") | |
| directUrl = env("DIRECT_DATABASE_URL") | |
| relationMode = "prisma" | |
| } | |
| datasource db { | |
| provider = "postgresql" | |
| url = env("DATABASE_URL") | |
| directUrl = env("DIRECT_DATABASE_URL") | |
| relationMode = "prisma" | |
| } |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Remove directUrl from datasource configuration.
No description provided.