[PR #7996] [MERGED] fix(db): infer default value for required attr properly #24574

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7996
Author: @jslno
Created: 2/16/2026
Status: Merged
Merged: 2/17/2026
Merged by: @Bekacru

Base: canaryHead: 02-16-2026/docs-plugins-schema-required


📝 Commits (6)

  • 8da70bb docs(plugins): fix default value for required attribute
  • d8d555e fix(db): infer default value correctly
  • 9d3dd1e Merge branch 'canary' into 02-16-2026/docs-plugins-schema-required
  • e49f9b2 chore(org): fix tests
  • bdeb5d8 chore: fix linting
  • 5fd36e8 Merge branch 'canary' into 02-16-2026/docs-plugins-schema-required

📊 Changes

3 files changed (+12 additions, -9 deletions)

View changed files

📝 docs/content/docs/concepts/plugins.mdx (+1 -1)
📝 packages/better-auth/src/db/field.ts (+4 -4)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+7 -4)

📄 Description

closes #7990


Summary by cubic

Fixes #7990 by defaulting DB fields to required and only making them optional when required: false. Docs updated and tests aligned with the new default.

  • Bug Fixes
    • Updated AddOptionalFields typing to infer fields as required unless required: false.
    • Aligned organization plugin tests and plugins schema docs to set required default to true.

Written for commit 5fd36e8321. Summary will update 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/7996 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/16/2026 **Status:** ✅ Merged **Merged:** 2/17/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `02-16-2026/docs-plugins-schema-required` --- ### 📝 Commits (6) - [`8da70bb`](https://github.com/better-auth/better-auth/commit/8da70bbe565ffc1ead206387ff2ede20c2486ec2) docs(plugins): fix default value for `required` attribute - [`d8d555e`](https://github.com/better-auth/better-auth/commit/d8d555e3643af701e25b38b3c1074881d1a5364b) fix(db): infer default value correctly - [`9d3dd1e`](https://github.com/better-auth/better-auth/commit/9d3dd1ecd7fee3f1581de4b3782236084c077260) Merge branch 'canary' into 02-16-2026/docs-plugins-schema-required - [`e49f9b2`](https://github.com/better-auth/better-auth/commit/e49f9b21883846be9c6b90941b63a02b12c17847) chore(org): fix tests - [`bdeb5d8`](https://github.com/better-auth/better-auth/commit/bdeb5d875bd3f483dbbb1480e7a66f95f7067e88) chore: fix linting - [`5fd36e8`](https://github.com/better-auth/better-auth/commit/5fd36e8321b00b14779b6e546eca88a2e6d02f07) Merge branch 'canary' into 02-16-2026/docs-plugins-schema-required ### 📊 Changes **3 files changed** (+12 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/plugins.mdx` (+1 -1) 📝 `packages/better-auth/src/db/field.ts` (+4 -4) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+7 -4) </details> ### 📄 Description closes #7990 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes #7990 by defaulting DB fields to required and only making them optional when `required: false`. Docs updated and tests aligned with the new default. - **Bug Fixes** - Updated AddOptionalFields typing to infer fields as required unless `required: false`. - Aligned organization plugin tests and plugins schema docs to set `required` default to `true`. <sup>Written for commit 5fd36e8321b00b14779b6e546eca88a2e6d02f07. Summary will update 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-04-15 22:26:32 -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#24574