[PR #4466] [MERGED] feat(sqlite): remove autoincrement for SQLite #5397

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4466
Author: @pspeter3
Created: 9/5/2025
Status: Merged
Merged: 9/9/2025
Merged by: @himself65

Base: canaryHead: sqlite-remove-autoincrement


📝 Commits (2)

  • f21a978 feat(sqlite) Remove autoincrement for SQLite
  • 6c89b6c Merge branch 'canary' into sqlite-remove-autoincrement

📊 Changes

5 files changed (+18 additions, -14 deletions)

View changed files

📝 packages/better-auth/src/db/get-migration.ts (+1 -1)
📝 packages/cli/src/generators/drizzle.ts (+2 -0)
📝 packages/cli/src/generators/prisma.ts (+5 -3)
📝 packages/cli/test/__snapshots__/auth-schema-sqlite-number-id.txt (+5 -5)
📝 packages/cli/test/__snapshots__/auth-schema-sqlite-passkey-number-id.txt (+5 -5)

📄 Description

SQLite recommends not using autoincrement for its tables.

Closes #4464


Summary by cubic

Remove AUTOINCREMENT from SQLite integer primary keys in migrations and schema generators. Aligns with SQLite guidance; Postgres/MySQL behavior unchanged.

  • Migration
    • Regenerate Drizzle/Prisma schema for SQLite projects using numeric IDs.
    • If existing tables use AUTOINCREMENT, create a migration to recreate them as INTEGER PRIMARY KEY (no autoincrement).

🔄 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/4466 **Author:** [@pspeter3](https://github.com/pspeter3) **Created:** 9/5/2025 **Status:** ✅ Merged **Merged:** 9/9/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `sqlite-remove-autoincrement` --- ### 📝 Commits (2) - [`f21a978`](https://github.com/better-auth/better-auth/commit/f21a978bb7bc204edc850eee5914890f857166d3) feat(sqlite) Remove autoincrement for SQLite - [`6c89b6c`](https://github.com/better-auth/better-auth/commit/6c89b6c36de4730631b619f3b0b0c6ca8e37558d) Merge branch 'canary' into sqlite-remove-autoincrement ### 📊 Changes **5 files changed** (+18 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/get-migration.ts` (+1 -1) 📝 `packages/cli/src/generators/drizzle.ts` (+2 -0) 📝 `packages/cli/src/generators/prisma.ts` (+5 -3) 📝 `packages/cli/test/__snapshots__/auth-schema-sqlite-number-id.txt` (+5 -5) 📝 `packages/cli/test/__snapshots__/auth-schema-sqlite-passkey-number-id.txt` (+5 -5) </details> ### 📄 Description SQLite recommends not using autoincrement for its tables. Closes #4464 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Remove AUTOINCREMENT from SQLite integer primary keys in migrations and schema generators. Aligns with SQLite guidance; Postgres/MySQL behavior unchanged. - **Migration** - Regenerate Drizzle/Prisma schema for SQLite projects using numeric IDs. - If existing tables use AUTOINCREMENT, create a migration to recreate them as INTEGER PRIMARY KEY (no autoincrement). <!-- 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:21:23 -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#5397