Skip to content

docs: fix MySQL Prisma account relation - #13473

Open
KariMuhammad wants to merge 2 commits into
nextauthjs:mainfrom
KariMuhammad:patch-2
Open

docs: fix MySQL Prisma account relation#13473
KariMuhammad wants to merge 2 commits into
nextauthjs:mainfrom
KariMuhammad:patch-2

Conversation

@KariMuhammad

@KariMuhammad KariMuhammad commented Jul 25, 2026

Copy link
Copy Markdown

☕️ Reasoning

The MySQL Prisma schema contains two inconsistencies in the relationship between User and Account:

  • userId is required, but the corresponding user relation is optional (User?).
  • userId has an @unique constraint, which prevents a user from linking multiple provider accounts despite User.accounts being an Account[].

This PR:

  • Changes the relation from User? to User.
  • Removes @unique from Account.userId.

This aligns the MySQL example with the PostgreSQL, SQLite, and MongoDB examples and correctly models the intended one-to-many relationship.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes #13472

📌 Resources

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth-docs Ready Ready Preview, Comment Jul 25, 2026 11:53am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
next-auth-docs Ignored Ignored Preview Jul 25, 2026 11:53am

Request Review

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@KariMuhammad is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@KariMuhammad KariMuhammad changed the title docs: require user in MySQL Prisma schema docs: fix MySQL Prisma account relation Jul 25, 2026
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.

MySQL Prisma schema has an inconsistent Account relation

1 participant