[PR #8614] [MERGED] fix(cli): treat omitted required as true in Drizzle and Prisma generators #25000

Closed
opened 2026-04-15 22:41:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8614
Author: @bytaesu
Created: 3/15/2026
Status: Merged
Merged: 3/16/2026
Merged by: @himself65

Base: canaryHead: 2026-03-15/fix/cli-required-default


📝 Commits (1)

  • a0e8ca4 fix(cli): treat omitted 'required' as true in Drizzle and Prisma generators

📊 Changes

4 files changed (+119 additions, -7 deletions)

View changed files

📝 packages/cli/src/generators/drizzle.ts (+1 -1)
📝 packages/cli/src/generators/prisma.ts (+2 -2)
📝 packages/cli/test/__snapshots__/auth-schema-sqlite-enum.txt (+1 -1)
📝 packages/cli/test/generate.test.ts (+115 -3)

📄 Description

Fields with omitted required (which defaults to true per DBFieldAttributeConfig) were incorrectly treated as nullable due to a falsy check on undefined.

https://github.com/better-auth/better-auth/blob/canary/packages/core/src/db/type.ts#L185-L189


🔄 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/8614 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 3/15/2026 **Status:** ✅ Merged **Merged:** 3/16/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-03-15/fix/cli-required-default` --- ### 📝 Commits (1) - [`a0e8ca4`](https://github.com/better-auth/better-auth/commit/a0e8ca46808a6f346807501c61f1cacbba841374) fix(cli): treat omitted 'required' as true in Drizzle and Prisma generators ### 📊 Changes **4 files changed** (+119 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/generators/drizzle.ts` (+1 -1) 📝 `packages/cli/src/generators/prisma.ts` (+2 -2) 📝 `packages/cli/test/__snapshots__/auth-schema-sqlite-enum.txt` (+1 -1) 📝 `packages/cli/test/generate.test.ts` (+115 -3) </details> ### 📄 Description Fields with omitted required (which defaults to true per DBFieldAttributeConfig) were incorrectly treated as nullable due to a falsy check on undefined. https://github.com/better-auth/better-auth/blob/canary/packages/core/src/db/type.ts#L185-L189 --- <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-04-15 22:41:03 -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#25000