Prisma, BetterAuth: Model Verification does not exist.

import { betterAuth } from "better-auth"
import { prismaAdapter } from "better-auth/adapters/prisma"
import { reactStartCookies } from "better-auth/react-start"

import { prisma } from "@/db"
import { env } from "@/env"

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "mysql",
debugLogs: true,
}),
socialProviders: {
google: {
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
},
},
plugins: [reactStartCookies()],
})
import { betterAuth } from "better-auth"
import { prismaAdapter } from "better-auth/adapters/prisma"
import { reactStartCookies } from "better-auth/react-start"

import { prisma } from "@/db"
import { env } from "@/env"

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "mysql",
debugLogs: true,
}),
socialProviders: {
google: {
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
},
},
plugins: [reactStartCookies()],
})
error:
2025-10-18T12:16:01.593Z ERROR [Better Auth]: Model verification does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'

# SERVER_ERROR: [BetterAuthError: Model verification does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'] {
cause: undefined
}
2025-10-18T12:16:01.593Z ERROR [Better Auth]: Model verification does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'

# SERVER_ERROR: [BetterAuthError: Model verification does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'] {
cause: undefined
}
while the db is up to date with the new schema:
No description
Solution:
alright. I think @prisma/client wasnt updated for some reason, delete it and re-generated again. now fixed. dont know why npx prisma generate didnt update it as well
Jump to solution
6 Replies
Jealous
JealousOP3d ago
schema.prisma:
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}

model User {
id String @id @default(cuid())
name String @db.Text
email String
emailVerified Boolean @default(false)
image String? @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
sessions Session[]
accounts Account[]

@@unique([email])
@@map("user")
}

model Session {
id String @id @default(cuid())
expiresAt DateTime
token String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
ipAddress String? @db.Text
userAgent String? @db.Text
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([token])
@@map("session")
}

model Account {
id String @id @default(cuid())
accountId String @db.Text
providerId String @db.Text
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String? @db.Text
refreshToken String? @db.Text
idToken String? @db.Text
accessTokenExpiresAt DateTime?
refreshTokenExpiresAt DateTime?
scope String? @db.Text
password String? @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@map("account")
}

model Verification {
id String @id @default(cuid())
identifier String @db.Text
value String @db.Text
expiresAt DateTime
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt

@@map("verification")
}
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}

model User {
id String @id @default(cuid())
name String @db.Text
email String
emailVerified Boolean @default(false)
image String? @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
sessions Session[]
accounts Account[]

@@unique([email])
@@map("user")
}

model Session {
id String @id @default(cuid())
expiresAt DateTime
token String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
ipAddress String? @db.Text
userAgent String? @db.Text
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([token])
@@map("session")
}

model Account {
id String @id @default(cuid())
accountId String @db.Text
providerId String @db.Text
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String? @db.Text
refreshToken String? @db.Text
idToken String? @db.Text
accessTokenExpiresAt DateTime?
refreshTokenExpiresAt DateTime?
scope String? @db.Text
password String? @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@map("account")
}

model Verification {
id String @id @default(cuid())
identifier String @db.Text
value String @db.Text
expiresAt DateTime
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt

@@map("verification")
}
I've used npx @better-auth/cli generate, to generate this schema, and then ran npx prisma generate, npx prisma migrate dev
dotenv -e .env -- prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "mydb" at "127.0.0.1:3306"

Already in sync, no schema change or pending migration was found.

✔ Generated Prisma Client (v6.17.1) to ./prisma/generated/prisma in 84ms
dotenv -e .env -- prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "mydb" at "127.0.0.1:3306"

Already in sync, no schema change or pending migration was found.

✔ Generated Prisma Client (v6.17.1) to ./prisma/generated/prisma in 84ms
begot
begot3d ago
@Jealous have you pushed this to the db?
Jealous
JealousOP3d ago
as the last resort, yes I did after migrate didnt work
begot
begot3d ago
did that work?
Jealous
JealousOP3d ago
no
> dotenv -e .env -- prisma db push

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "mydb" at "127.0.0.1:3306"

The database is already in sync with the Prisma schema.

✔ Generated Prisma Client (v6.17.1) to ./node_modules/@prisma/client in 83ms
> dotenv -e .env -- prisma db push

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "mydb" at "127.0.0.1:3306"

The database is already in sync with the Prisma schema.

✔ Generated Prisma Client (v6.17.1) to ./node_modules/@prisma/client in 83ms
Solution
Jealous
Jealous3d ago
alright. I think @prisma/client wasnt updated for some reason, delete it and re-generated again. now fixed. dont know why npx prisma generate didnt update it as well

Did you find this page helpful?