[GH-ISSUE #52] custom model names are not working #16737

Closed
opened 2026-04-15 14:42:23 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @luksch42 on GitHub (Sep 30, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/52

Custom model names are not working.
This is my lib/auth.ts config

export const auth = betterAuth({ database: { provider: "postgres", url: Bun.env.DATABASE_URL, }, emailAndPassword: { enabled: true, }, logger: { disabled: true, verboseLogging: true, }, user: { modelName: "users", }, session: { modelName: "sessions", }, account: { modelName: "accounts", }, });

This is the result
ERROR: relation "user" does not exist at character 13 STATEMENT: insert into "user" ("id", "email", "name", "emailVerified", "createdAt", "updatedAt") values ($1, $2, $3, $4, $5, $6) returning *

Originally created by @luksch42 on GitHub (Sep 30, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/52 Custom model names are not working. This is my lib/auth.ts config `export const auth = betterAuth({ database: { provider: "postgres", url: Bun.env.DATABASE_URL, }, emailAndPassword: { enabled: true, }, logger: { disabled: true, verboseLogging: true, }, user: { modelName: "users", }, session: { modelName: "sessions", }, account: { modelName: "accounts", }, });` This is the result `ERROR: relation "user" does not exist at character 13 STATEMENT: insert into "user" ("id", "email", "name", "emailVerified", "createdAt", "updatedAt") values ($1, $2, $3, $4, $5, $6) returning *`
GiteaMirror added the locked label 2026-04-15 14:42: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#16737