[PR #1191] [MERGED] fix: fixed number mapping for rate limit migration #3677

Closed
opened 2026-03-13 11:04:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1191
Author: @iqorex
Created: 1/11/2025
Status: Merged
Merged: 1/11/2025
Merged by: @Bekacru

Base: mainHead: fix/rate-limit-database-migartion


📝 Commits (4)

📊 Changes

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

View changed files

📝 packages/better-auth/src/db/field.ts (+4 -0)
📝 packages/better-auth/src/db/get-migration.ts (+4 -4)
📝 packages/better-auth/src/db/get-tables.ts (+1 -0)

📄 Description

closes #1190 closes #1154

lastRequest column on rate limit table was using int4 since we stored timestamp in ms it was way over int4 limit so we need to change it to int8. This is the only table in better auth package that has number in schema, so for now this fix should be okay but i can take a look and implement more customizable approach for database types so in future for example all fields that have type of number won't use int8 but instead specified by schema/options


🔄 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/1191 **Author:** [@iqorex](https://github.com/iqorex) **Created:** 1/11/2025 **Status:** ✅ Merged **Merged:** 1/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/rate-limit-database-migartion` --- ### 📝 Commits (4) - [`4b7c7b1`](https://github.com/better-auth/better-auth/commit/4b7c7b155aebc15b363a4f78d5b0bebaf319f2b0) fixed number mapping - [`0035721`](https://github.com/better-auth/better-auth/commit/0035721274eb8b54f0daa26a1cbd70df0708a295) fixed wrong parsing of big int - [`6cd513c`](https://github.com/better-auth/better-auth/commit/6cd513c29c809dfe8a9c905ff7b73385add24263) added bigint type - [`6aaa6f5`](https://github.com/better-auth/better-auth/commit/6aaa6f5fd7a633a8672ce66284c857583e38f518) added description ### 📊 Changes **3 files changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/field.ts` (+4 -0) 📝 `packages/better-auth/src/db/get-migration.ts` (+4 -4) 📝 `packages/better-auth/src/db/get-tables.ts` (+1 -0) </details> ### 📄 Description closes #1190 closes #1154 lastRequest column on rate limit table was using int4 since we stored timestamp in ms it was way over int4 limit so we need to change it to int8. This is the only table in better auth package that has number in schema, so for now this fix should be okay but i can take a look and implement more customizable approach for database types so in future for example all fields that have type of number won't use int8 but instead specified by schema/options --- <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 11:04: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#3677