Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ generator client {
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
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.

relationMode = "prisma"
}
Comment on lines 7 to 10

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!


model User {
Expand Down