[PR #7276] fix(cli): support drizzle json type defaults #24092

Open
opened 2026-04-15 22:10:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7276
Author: @brandon-pereira
Created: 1/11/2026
Status: 🔄 Open

Base: mainHead: fix/cli-pg-drizzle-json-default-generation


📝 Commits (1)

  • 69e82e5 fix(cli): fix issue with drizzle json type incorrectly stringifying default values

📊 Changes

2 files changed (+37 additions, -0 deletions)

View changed files

📝 packages/cli/src/generators/drizzle.ts (+6 -0)
📝 packages/cli/test/generate.test.ts (+31 -0)

📄 Description

  • Adds support for JSON defaultValue in CLI generator
  • Adds test for new functionality

Fixes #7275


Summary by cubic

Fixes JSON default handling in the CLI Drizzle schema generator for Postgres. JSON defaults are now emitted as .default({ ... }) on jsonb columns (not stringified), with tests added.

Written for commit 69e82e5b00. 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/7276 **Author:** [@brandon-pereira](https://github.com/brandon-pereira) **Created:** 1/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/cli-pg-drizzle-json-default-generation` --- ### 📝 Commits (1) - [`69e82e5`](https://github.com/better-auth/better-auth/commit/69e82e5b005eedb8e31c5a8ff4c0b7e9fdd602f1) fix(cli): fix issue with drizzle json type incorrectly stringifying default values ### 📊 Changes **2 files changed** (+37 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/generators/drizzle.ts` (+6 -0) 📝 `packages/cli/test/generate.test.ts` (+31 -0) </details> ### 📄 Description - Adds support for JSON defaultValue in CLI generator - Adds test for new functionality Fixes #7275 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes JSON default handling in the CLI Drizzle schema generator for Postgres. JSON defaults are now emitted as .default({ ... }) on jsonb columns (not stringified), with tests added. <sup>Written for commit 69e82e5b005eedb8e31c5a8ff4c0b7e9fdd602f1. 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-04-15 22:10:18 -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#24092