[GH-ISSUE #6262] Add option to rename relations #10465

Closed
opened 2026-04-13 06:38:04 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @antonykamp on GitHub (Nov 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6262

Is this suited for github?

  • Yes, this is suited for github

When I enable the experimental join feature and generate the schema, I am required to use the generated names of the relations in my Prisma schema. The generated ones doesn't match the case style I use.

Describe the solution you'd like

I'd love to have an option in the better auth configuration object to rename the relation, like a field:

 user: {
    fields: {
      name: "firstName"
      usersessions: "UserSessions"
    }
}

Describe alternatives you've considered

Right now I have to rename the relations in my prisma schema.

Additional context

No response

Originally created by @antonykamp on GitHub (Nov 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6262 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. When I enable the experimental join feature and generate the schema, I am required to use the generated names of the relations in my Prisma schema. The generated ones doesn't match the case style I use. ### Describe the solution you'd like I'd love to have an option in the better auth configuration object to rename the relation, like a field: ```ts user: { fields: { name: "firstName" usersessions: "UserSessions" } } ``` ### Describe alternatives you've considered Right now I have to rename the relations in my prisma schema. ### Additional context _No response_
GiteaMirror added the enhancementlocked labels 2026-04-13 06:38:04 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 24, 2025):

Hi there, thanks for opening an issue! Currently, the experimental join feature auto-generates relation names based on internal conventions, and there isn’t an option to customize or rename them in the configuration. We understand that this can be a pain if your naming style differs from the defaults. As a workaround, you’ll need to manually adjust the relation names in your Prisma schema. We appreciate your suggestion and will consider it for future releases.

tag @better-auth-agent if you would like an answer from the Agent.

Could you share any additional details about your naming conventions or any specific needs this feature would address for your project?

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3570748288 --> @better-auth-agent[bot] commented on GitHub (Nov 24, 2025): Hi there, thanks for opening an issue! Currently, the experimental join feature auto-generates relation names based on internal conventions, and there isn’t an option to customize or rename them in the configuration. We understand that this can be a pain if your naming style differs from the defaults. As a workaround, you’ll need to manually adjust the relation names in your Prisma schema. We appreciate your suggestion and will consider it for future releases. tag @better-auth-agent if you would like an answer from the Agent. Could you share any additional details about your naming conventions or any specific needs this feature would address for your project? <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@antonykamp commented on GitHub (Nov 24, 2025):

Thank you for the (automated) response 😉 We use pascal case.

<!-- gh-comment-id:3570757136 --> @antonykamp commented on GitHub (Nov 24, 2025): Thank you for the (automated) response 😉 We use pascal case.
Author
Owner

@GautamBytes commented on GitHub (Nov 24, 2025):

Will work on this @antonykamp

<!-- gh-comment-id:3570997797 --> @GautamBytes commented on GitHub (Nov 24, 2025): Will work on this @antonykamp
Author
Owner

@dosubot[bot] commented on GitHub (Feb 23, 2026):

Hi, @antonykamp. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested a feature to customize relation names generated by Prisma's experimental join feature to use PascalCase.
  • Currently, no configuration exists for this, and manual renaming in the schema is the suggested workaround.
  • The better-auth team acknowledged your preference and expressed interest in adding this feature.
  • A maintainer committed to working on this feature, but it remains unresolved.

Next Steps:

  • Please let me know if this feature is still relevant to the latest version of better-auth by commenting on this issue.
  • If I do not hear from you within 7 days, this issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3945746052 --> @dosubot[bot] commented on GitHub (Feb 23, 2026): Hi, @antonykamp. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested a feature to customize relation names generated by Prisma's experimental join feature to use PascalCase. - Currently, no configuration exists for this, and manual renaming in the schema is the suggested workaround. - The better-auth team acknowledged your preference and expressed interest in adding this feature. - A maintainer committed to working on this feature, but it remains unresolved. **Next Steps:** - Please let me know if this feature is still relevant to the latest version of better-auth by commenting on this issue. - If I do not hear from you within 7 days, this issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10465