Missing 'account' table breaks Better Auth sign-up flow #12

Closed
opened 2026-04-27 17:55:55 +00:00 by TopherMayor · 0 comments
Owner

Description

After fixing the email_verified schema (#9), sign-up now creates the user record successfully but returns 500 because Better Auth expects an account table to store credential records.

Error

BetterAuthError: [# Drizzle Adapter]: The model "account" was not found in the schema object.

Impact

  • User record IS created in users table (confirmed working)
  • But no session is created (empty sessions table)
  • User cannot complete sign-in (500 error)
  • The app creates the user but can't finish the auth flow

Fix

Add the account table to the Drizzle schema and create a migration. Better Auth requires these core tables:

  • users (exists)
  • sessions (exists)
  • accounts (MISSING — stores OAuth/credential providers)
  • verifications (optional — for email verification)

Schema should follow Better Auth conventions. See: https://www.better-auth.com/docs/concepts/database

Severity: High

Sign-up creates orphaned users with no session. Full auth flow is broken.

## Description After fixing the email_verified schema (#9), sign-up now creates the user record successfully but returns 500 because Better Auth expects an `account` table to store credential records. ## Error ``` BetterAuthError: [# Drizzle Adapter]: The model "account" was not found in the schema object. ``` ## Impact - User record IS created in `users` table (confirmed working) - But no session is created (empty `sessions` table) - User cannot complete sign-in (500 error) - The app creates the user but can't finish the auth flow ## Fix Add the `account` table to the Drizzle schema and create a migration. Better Auth requires these core tables: - `users` (exists) - `sessions` (exists) - `accounts` (MISSING — stores OAuth/credential providers) - `verifications` (optional — for email verification) Schema should follow Better Auth conventions. See: https://www.better-auth.com/docs/concepts/database ## Severity: High Sign-up creates orphaned users with no session. Full auth flow is broken.
TopherMayor added the bug label 2026-04-27 17:55:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TopherMayor/comparaison#12