[PR #7551] [MERGED] fix(core): consolidate rateLimit table schema definition #7394

Closed
opened 2026-03-13 13:34:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7551
Author: @bytaesu
Created: 1/22/2026
Status: Merged
Merged: 1/22/2026
Merged by: @himself65

Base: canaryHead: 2026-01-22/fix/duplicate-ratelimit-table-schema


📝 Commits (1)

  • e1bab28 fix(core): consolidate rateLimit table schema definition

📊 Changes

2 files changed (+5 additions, -36 deletions)

View changed files

📝 packages/core/src/db/adapter/factory.ts (+0 -36)
📝 packages/core/src/db/get-tables.ts (+5 -0)

📄 Description


Summary by cubic

Consolidated the rateLimit table schema into getAuthTables and removed the duplicate definition from the adapter factory. This ensures consistent constraints and avoids schema drift across adapters.

  • Bug Fixes
    • Single source of truth for the rateLimit table schema in getAuthTables.
    • Enforced constraints: key is unique and required; count and lastRequest are required; lastRequest defaults to Date.now().
    • Preserves configurable field names via options.rateLimit.fields.

Written for commit e1bab2807f. 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/7551 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/22/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-01-22/fix/duplicate-ratelimit-table-schema` --- ### 📝 Commits (1) - [`e1bab28`](https://github.com/better-auth/better-auth/commit/e1bab2807f47698db6fd214570bccd5b449327c7) fix(core): consolidate rateLimit table schema definition ### 📊 Changes **2 files changed** (+5 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/db/adapter/factory.ts` (+0 -36) 📝 `packages/core/src/db/get-tables.ts` (+5 -0) </details> ### 📄 Description - Closes https://github.com/better-auth/better-auth/issues/7518 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Consolidated the rateLimit table schema into getAuthTables and removed the duplicate definition from the adapter factory. This ensures consistent constraints and avoids schema drift across adapters. - **Bug Fixes** - Single source of truth for the rateLimit table schema in getAuthTables. - Enforced constraints: key is unique and required; count and lastRequest are required; lastRequest defaults to Date.now(). - Preserves configurable field names via options.rateLimit.fields. <sup>Written for commit e1bab2807f47698db6fd214570bccd5b449327c7. 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-03-13 13:34:39 -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#7394