mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-03 08:49:26 -05:00
* feat: support stroring dispaly username to store un-normalized username * test: update snapshot
85 lines
2.0 KiB
Plaintext
85 lines
2.0 KiB
Plaintext
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id
|
|
name String @db.Text
|
|
email String
|
|
emailVerified Boolean
|
|
image String? @db.Text
|
|
createdAt DateTime
|
|
updatedAt DateTime
|
|
twoFactorEnabled Boolean?
|
|
username String?
|
|
displayUsername String? @db.Text
|
|
sessions Session[]
|
|
accounts Account[]
|
|
twofactors TwoFactor[]
|
|
|
|
@@unique([email])
|
|
@@unique([username])
|
|
@@map("user")
|
|
}
|
|
|
|
model Session {
|
|
id String @id
|
|
expiresAt DateTime
|
|
token String
|
|
createdAt DateTime
|
|
updatedAt DateTime
|
|
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
|
|
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
|
|
updatedAt DateTime
|
|
|
|
@@map("account")
|
|
}
|
|
|
|
model Verification {
|
|
id String @id
|
|
identifier String @db.Text
|
|
value String @db.Text
|
|
expiresAt DateTime
|
|
createdAt DateTime?
|
|
updatedAt DateTime?
|
|
|
|
@@map("verification")
|
|
}
|
|
|
|
model TwoFactor {
|
|
id String @id
|
|
secret String @db.Text
|
|
backupCodes String @db.Text
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@map("twoFactor")
|
|
}
|