-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Description:
I have a database schema like this:
model User {
id Decimal @id @default(dbgenerated("nextval('\"User_id_seq\"'::regclass)")) @db.Decimal(23, 0)
}
Some id values are very large, for example:
6302764515981008896
However, the value gets automatically rounded to:
6302764515981009000
When clicking on a user row, the routing uses the rounded value, and this causes the following error:
page.tsx:29 Server error: PrismaClientKnownRequestError:
Invalid `prisma.user.findUniqueOrThrow()` invocation:
An operation failed because it depends on one or more records that were required but not found.
No record was found for the query.
This happens because the rounded ID does not actually exist in the database.
So it also causes an error when performing CRUD operations, for example:
Invalid `prisma.user.update()` invocation:
An operation failed because it depends on one or more records that were required but not found.
No record was found for an update.
Reproduction URL
n/a
Reproduction steps
n/aNext router
Page router
Next Admin version
^8.4.1
Screenshots
Next Admin options
Logs
Browsers
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working