[PR #6459] [MERGED] fix(cli): compatibility for Prisma v7 in schema generation #6680

Closed
opened 2026-03-13 13:07:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6459
Author: @himself65
Created: 12/1/2025
Status: Merged
Merged: 12/2/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/12/01/compatable-with-prisma-v7


📝 Commits (5)

  • 21ed4d0 fix(cli): compatibility for Prisma v7 in schema generation
  • 9de0826 fix(cli): compatibility for Prisma v7 in schema generation
  • a04c88f fix(cli): compatibility for Prisma v7 in schema generation
  • 849b035 Merge branch 'canary' into himself65/2025/12/01/compatable-with-prisma-v7
  • e8d4faa ci: fix

📊 Changes

3 files changed (+264 additions, -4 deletions)

View changed files

📝 packages/cli/src/generators/prisma.ts (+30 -4)
📝 packages/cli/src/utils/get-package-info.ts (+23 -0)
📝 packages/cli/test/generate.test.ts (+211 -0)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/6277


Summary by cubic

Adds Prisma v7 compatibility to the CLI schema generator by detecting the installed Prisma version and using the correct client provider, with automatic updates for existing schemas. Prevents generator mismatches and errors when using Prisma v7.

  • Bug Fixes
    • Detect Prisma major version from package.json (prisma or @prisma/client).
    • Use "prisma-client" for v7+ and "prisma-client-js" for older versions; auto-update existing generator blocks when v7 is detected.
    • Add tests covering version detection and schema output for v5, v6, and v7.

Written for commit e8d4faa00f. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6459 **Author:** [@himself65](https://github.com/himself65) **Created:** 12/1/2025 **Status:** ✅ Merged **Merged:** 12/2/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/12/01/compatable-with-prisma-v7` --- ### 📝 Commits (5) - [`21ed4d0`](https://github.com/better-auth/better-auth/commit/21ed4d0baf0bd495bf2239da24080b8e1ad5223e) fix(cli): compatibility for Prisma v7 in schema generation - [`9de0826`](https://github.com/better-auth/better-auth/commit/9de0826d8e9cef1d98542aa5d9f76073d96e94dc) fix(cli): compatibility for Prisma v7 in schema generation - [`a04c88f`](https://github.com/better-auth/better-auth/commit/a04c88fce43f07b2c0e0e263ae07dff7b5557006) fix(cli): compatibility for Prisma v7 in schema generation - [`849b035`](https://github.com/better-auth/better-auth/commit/849b03580096554eba504f80ead4def6c2570d76) Merge branch 'canary' into himself65/2025/12/01/compatable-with-prisma-v7 - [`e8d4faa`](https://github.com/better-auth/better-auth/commit/e8d4faa00f6fde0452304c72f9a2424b1b721522) ci: fix ### 📊 Changes **3 files changed** (+264 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/generators/prisma.ts` (+30 -4) 📝 `packages/cli/src/utils/get-package-info.ts` (+23 -0) 📝 `packages/cli/test/generate.test.ts` (+211 -0) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/6277 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds Prisma v7 compatibility to the CLI schema generator by detecting the installed Prisma version and using the correct client provider, with automatic updates for existing schemas. Prevents generator mismatches and errors when using Prisma v7. - **Bug Fixes** - Detect Prisma major version from package.json (prisma or @prisma/client). - Use "prisma-client" for v7+ and "prisma-client-js" for older versions; auto-update existing generator blocks when v7 is detected. - Add tests covering version detection and schema output for v5, v6, and v7. <sup>Written for commit e8d4faa00f6fde0452304c72f9a2424b1b721522. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:07:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6680