[PR #4264] [MERGED] fix(oidc): specify foreign key references in the schema #22183

Closed
opened 2026-04-15 20:52:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4264
Author: @julen
Created: 8/27/2025
Status: Merged
Merged: 8/29/2025
Merged by: @himself65

Base: canaryHead: fix/oidc-schema-fks


📝 Commits (3)

  • 7c2917a fix: oidc plugin schema foreign key
  • 1b035ff fix(oidc): add foreign key references to oauthApplication
  • da0c3db fix(oidc): update schema in docs

📊 Changes

2 files changed (+29 additions, -3 deletions)

View changed files

📝 docs/content/docs/plugins/oidc-provider.mdx (+4 -3)
📝 packages/better-auth/src/plugins/oidc-provider/schema.ts (+25 -0)

📄 Description

This changeset updates the DB schema to specify missing foreign key references in OIDC-related tables and updates the docs accordingly.

Fixes #4162.


Summary by cubic

Specify foreign key references in OIDC tables to enforce referential integrity and cascade deletes: userId now references user.id and clientId now references oauthApplication.clientId. Update plugin docs to match, correcting previous oauthClient references.


🔄 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/4264 **Author:** [@julen](https://github.com/julen) **Created:** 8/27/2025 **Status:** ✅ Merged **Merged:** 8/29/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/oidc-schema-fks` --- ### 📝 Commits (3) - [`7c2917a`](https://github.com/better-auth/better-auth/commit/7c2917a012cf45c051e664c254e1700dafb67997) fix: oidc plugin schema foreign key - [`1b035ff`](https://github.com/better-auth/better-auth/commit/1b035ff7df430b92354204ab97c7b587b20e01a0) fix(oidc): add foreign key references to oauthApplication - [`da0c3db`](https://github.com/better-auth/better-auth/commit/da0c3db803bc9e7b2ff87d75f61a33633fd2894a) fix(oidc): update schema in docs ### 📊 Changes **2 files changed** (+29 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/oidc-provider.mdx` (+4 -3) 📝 `packages/better-auth/src/plugins/oidc-provider/schema.ts` (+25 -0) </details> ### 📄 Description This changeset updates the DB schema to specify missing foreign key references in OIDC-related tables and updates the docs accordingly. Fixes #4162. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Specify foreign key references in OIDC tables to enforce referential integrity and cascade deletes: userId now references user.id and clientId now references oauthApplication.clientId. Update plugin docs to match, correcting previous oauthClient references. <!-- 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 20:52:28 -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#22183