Skip to content

Commit

Permalink
Clarify schema in Prisma docs (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper authored Jun 8, 2024
1 parent 6fd5f7e commit 121498d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/pages/database/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm install @lucia-auth/adapter-prisma

## Schema

While Lucia does not enforce model names, the relation name (`user`) in the session model must be the camel-case version of the user model name. For example, if the user model was named `AuthUser`, the relation must be named `Session.authUser`.
The data field names and types must exactly match the ones in the schema below. While you can change the model names, the relation name in the session model (`Session.user`) must be the camel-case version of the user model name. For example, if the user model was named `AuthUser`, the relation must be named `Session.authUser`.

User ID can be numeric (see [Define user ID type](/basics/users#define-user-id-type)) but session ID must be a string type.

Expand All @@ -26,6 +26,7 @@ model Session {
id String @id
userId String
expiresAt DateTime
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
}
```
Expand Down

0 comments on commit 121498d

Please sign in to comment.