[PR #5408] [MERGED] fix(drizzle): replace pgEnum with text enum type in Drizzle schema generation #5989

Closed
opened 2026-03-13 12:43:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5408
Author: @eni4sure
Created: 10/18/2025
Status: Merged
Merged: 10/19/2025
Merged by: @himself65

Base: canaryHead: fix/drizzle-enum


📝 Commits (1)

  • 2ff93ff fix: replace pgEnum with text enum type in Drizzle schema generation

📊 Changes

3 files changed (+5 additions, -42 deletions)

View changed files

📝 packages/cli/src/generators/drizzle.ts (+1 -13)
📝 packages/cli/test/__snapshots__/auth-schema-pg-enum.txt (+2 -2)
📝 packages/cli/test/generate.test.ts (+2 -27)

📄 Description

drizzle schema generation PgEnum not properly implemented.
Also see


Summary by cubic

Replaced pgEnum with the text enum column type for PostgreSQL in Drizzle schema generation to fix incorrect enum handling. This aligns with Drizzle docs and removes the need for pgEnum imports.

  • Bug Fixes
    • Generate pg enums as text("name", { enum: [...] }) instead of pgEnum("name", [...]).
    • Removed pgEnum import logic from the generator.
    • Updated tests and snapshots to reflect the new output.

🔄 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/5408 **Author:** [@eni4sure](https://github.com/eni4sure) **Created:** 10/18/2025 **Status:** ✅ Merged **Merged:** 10/19/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/drizzle-enum` --- ### 📝 Commits (1) - [`2ff93ff`](https://github.com/better-auth/better-auth/commit/2ff93ffec39a883afd21ce038410d693897443a0) fix: replace pgEnum with text enum type in Drizzle schema generation ### 📊 Changes **3 files changed** (+5 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/generators/drizzle.ts` (+1 -13) 📝 `packages/cli/test/__snapshots__/auth-schema-pg-enum.txt` (+2 -2) 📝 `packages/cli/test/generate.test.ts` (+2 -27) </details> ### 📄 Description drizzle schema generation PgEnum not properly implemented. Also see - https://github.com/better-auth/better-auth/pull/5287/files#r2427569929 - https://orm.drizzle.team/docs/column-types/pg#enum <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Replaced pgEnum with the text enum column type for PostgreSQL in Drizzle schema generation to fix incorrect enum handling. This aligns with Drizzle docs and removes the need for pgEnum imports. - **Bug Fixes** - Generate pg enums as text("name", { enum: [...] }) instead of pgEnum("name", [...]). - Removed pgEnum import logic from the generator. - Updated tests and snapshots to reflect the new output. <!-- 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 12:43:53 -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#5989