Skip to content

Update schema.prisma#4201

Open
riccardoq76 wants to merge 5 commits intoumami-software:masterfrom
riccardoq76:master
Open

Update schema.prisma#4201
riccardoq76 wants to merge 5 commits intoumami-software:masterfrom
riccardoq76:master

Conversation

@riccardoq76
Copy link
Copy Markdown

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

@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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR adds directUrl = env(\"DIRECT_DATABASE_URL\") to the Prisma datasource block (intended for connection-pooler setups where migrations need a direct DB connection) and removes indentation from that block.

  • The new directUrl field makes DIRECT_DATABASE_URL required in every environment — Prisma will error at prisma generate and at startup if this variable is unset. Existing deployments and CI pipelines that don't define it will break immediately after this merges.

Confidence Score: 3/5

Not 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

Filename Overview
prisma/schema.prisma Adds directUrl = env("DIRECT_DATABASE_URL") to the datasource block and removes indentation; the new env var is required by Prisma at runtime and will break deployments that don't define it.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "Update schema.prisma" | Re-trigger Greptile

Comment thread prisma/schema.prisma Outdated
relationMode = "prisma"
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_DATABASE_URL")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment thread prisma/schema.prisma
Comment on lines 7 to 12
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
relationMode = "prisma"
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_DATABASE_URL")
relationMode = "prisma"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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!

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