[PR #5880] fix(adapter): default value in prisma schema #14538

Closed
opened 2026-04-13 09:31:26 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5880

State: closed
Merged: No


Summary by cubic

Fix default value generation in Prisma schema so fields get valid defaults across providers. For MySQL, avoid invalid defaults on TEXT and support long string defaults via dbgenerated.

  • Bug Fixes
    • Apply default(...) for string, boolean, and number fields; for MySQL strings, only when the value is <255 chars.
    • For MySQL strings: use @db.Text only when there’s no default or the default is >255 chars; for long defaults, set default(dbgenerated(...)).
    • Added snapshot tests for PostgreSQL and MySQL; updated MySQL custom snapshots for role and status defaults.

Written for commit 4c931cb545. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5880 **State:** closed **Merged:** No --- <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fix default value generation in Prisma schema so fields get valid defaults across providers. For MySQL, avoid invalid defaults on TEXT and support long string defaults via dbgenerated. - **Bug Fixes** - Apply default(...) for string, boolean, and number fields; for MySQL strings, only when the value is <255 chars. - For MySQL strings: use @db.Text only when there’s no default or the default is >255 chars; for long defaults, set default(dbgenerated(...)). - Added snapshot tests for PostgreSQL and MySQL; updated MySQL custom snapshots for role and status defaults. <sup>Written for commit 4c931cb5454cd375aa126bda127fff40ec2e7b69. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:26 -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#14538