[PR #8092] [MERGED] fix(db): handle camelCase postgres metadata keys in migration schema detection #7741

Closed
opened 2026-03-13 13:47:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: 2026-02-22/fix/postgres-metadata-camelcase


📝 Commits (2)

  • c9efe4f fix(db): handle camelCase postgres metadata keys in migration schema detection
  • 476e962 test: issue number

📊 Changes

2 files changed (+75 additions, -13 deletions)

View changed files

📝 packages/better-auth/src/db/get-migration-schema.test.ts (+53 -0)
📝 packages/better-auth/src/db/get-migration.ts (+22 -13)

📄 Description

Note

https://kysely-org.github.io/kysely-apidoc/classes/CamelCasePlugin.html


Summary by cubic

Fix migration schema detection for Postgres when Kysely CamelCasePlugin is enabled, preventing false schema checks and duplicate table creation. Closes #7926.

  • Bug Fixes
    • Read both snake_case and camelCase keys for search_path, schema_name, and table_name.
    • Correctly verifies schema existence and filters tables in the active schema with CamelCasePlugin.
    • Adds a Postgres test using CamelCasePlugin to confirm custom schema detection and avoid recreating existing tables.

Written for commit 476e962140. 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/8092 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/22/2026 **Status:** ✅ Merged **Merged:** 2/22/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-02-22/fix/postgres-metadata-camelcase` --- ### 📝 Commits (2) - [`c9efe4f`](https://github.com/better-auth/better-auth/commit/c9efe4f9df34a97cbd754450537c873b051ea4ce) fix(db): handle camelCase postgres metadata keys in migration schema detection - [`476e962`](https://github.com/better-auth/better-auth/commit/476e962140c8b4015a974f294abbc1e6852dfa36) test: issue number ### 📊 Changes **2 files changed** (+75 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/get-migration-schema.test.ts` (+53 -0) 📝 `packages/better-auth/src/db/get-migration.ts` (+22 -13) </details> ### 📄 Description > [!NOTE] > https://kysely-org.github.io/kysely-apidoc/classes/CamelCasePlugin.html - Closes #7926 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix migration schema detection for Postgres when Kysely CamelCasePlugin is enabled, preventing false schema checks and duplicate table creation. Closes #7926. - **Bug Fixes** - Read both snake_case and camelCase keys for search_path, schema_name, and table_name. - Correctly verifies schema existence and filters tables in the active schema with CamelCasePlugin. - Adds a Postgres test using CamelCasePlugin to confirm custom schema detection and avoid recreating existing tables. <sup>Written for commit 476e962140c8b4015a974f294abbc1e6852dfa36. 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:47:50 -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#7741