[PR #1329] [MERGED] Fix incorrect call to getModelName #29359

Closed
opened 2026-04-17 20:42:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1329
Author: @chrnorm
Created: 2/1/2025
Status: Merged
Merged: 2/2/2025
Merged by: @Bekacru

Base: mainHead: fix-invalid-model-name


📝 Commits (1)

  • 9d0e17b Fix incorrect call to getModelName

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+1 -1)

📄 Description

getSchema already calls getModelName. When custom tables are used, this results in a bug where better-auth can't find the table name:

TypeError: undefined is not an object

This PR fixes the incorrect call to getModelName.


🔄 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/1329 **Author:** [@chrnorm](https://github.com/chrnorm) **Created:** 2/1/2025 **Status:** ✅ Merged **Merged:** 2/2/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix-invalid-model-name` --- ### 📝 Commits (1) - [`9d0e17b`](https://github.com/better-auth/better-auth/commit/9d0e17b6a65e79b830d2e211d34a545ed0b32978) Fix incorrect call to `getModelName` ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+1 -1) </details> ### 📄 Description `getSchema` already calls `getModelName`. When custom tables are used, this results in a bug where better-auth can't find the table name: ``` TypeError: undefined is not an object ``` This PR fixes the incorrect call to `getModelName`. --- <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-17 20:42:37 -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#29359