[PR #8358] fix(cli): respect disableMigration flag in schema generation #24822

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8358
Author: @himself65
Created: 3/4/2026
Status: 🔄 Open

Base: mainHead: fix/disable-migration-generate


📝 Commits (1)

  • c1e2d29 fix(cli): respect disableMigration flag in schema generation

📊 Changes

7 files changed (+41 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/db/get-schema.ts (+1 -0)
📝 packages/cli/src/generators/drizzle.ts (+2 -0)
📝 packages/cli/src/generators/prisma.ts (+3 -0)
📝 packages/core/src/db/get-tables.ts (+6 -1)
📝 packages/core/src/db/plugin.ts (+4 -0)
📝 packages/core/src/db/test/get-tables.test.ts (+24 -0)
📝 packages/core/src/db/type.ts (+1 -1)

📄 Description

Summary

  • Fixes plugin schemas with disableMigration: true being incorrectly included in generated schema output by the generate CLI command
  • Preserves the disableMigration flag from plugin schemas through getAuthTables() and filters those tables in all generators (Drizzle, Prisma, Kysely) and in getSchema()

Closes #8347

Test plan

  • Added unit test verifying disableMigrations is preserved from plugin schema in getAuthTables()
  • Existing tests pass (vitest packages/core/src/db/test/get-tables.test.ts)
  • Verify better-auth generate no longer emits tables with disableMigration: true

🔄 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/8358 **Author:** [@himself65](https://github.com/himself65) **Created:** 3/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/disable-migration-generate` --- ### 📝 Commits (1) - [`c1e2d29`](https://github.com/better-auth/better-auth/commit/c1e2d2967bde4610a68fab279d8c73ebce2ff9c2) fix(cli): respect disableMigration flag in schema generation ### 📊 Changes **7 files changed** (+41 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/get-schema.ts` (+1 -0) 📝 `packages/cli/src/generators/drizzle.ts` (+2 -0) 📝 `packages/cli/src/generators/prisma.ts` (+3 -0) 📝 `packages/core/src/db/get-tables.ts` (+6 -1) 📝 `packages/core/src/db/plugin.ts` (+4 -0) 📝 `packages/core/src/db/test/get-tables.test.ts` (+24 -0) 📝 `packages/core/src/db/type.ts` (+1 -1) </details> ### 📄 Description ## Summary - Fixes plugin schemas with `disableMigration: true` being incorrectly included in generated schema output by the `generate` CLI command - Preserves the `disableMigration` flag from plugin schemas through `getAuthTables()` and filters those tables in all generators (Drizzle, Prisma, Kysely) and in `getSchema()` Closes #8347 ## Test plan - [x] Added unit test verifying `disableMigrations` is preserved from plugin schema in `getAuthTables()` - [x] Existing tests pass (`vitest packages/core/src/db/test/get-tables.test.ts`) - [ ] Verify `better-auth generate` no longer emits tables with `disableMigration: true` --- <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:34:33 -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#24822