54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
generator client {
|
|
provider = "prisma-client"
|
|
output = "./generated"
|
|
moduleFormat = "cjs"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(nanoid())
|
|
|
|
phone String? @unique
|
|
email String? @unique
|
|
|
|
isPhoneVerified Boolean @default(false) @map("is_phone_verified")
|
|
isEmailVerified Boolean @default(false) @map("is_email_verified")
|
|
|
|
pendingContactChanges PendingContactChange[]
|
|
|
|
role Role @default(USER)
|
|
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("accounts")
|
|
}
|
|
|
|
model PendingContactChange {
|
|
id String @id @default(nanoid())
|
|
|
|
type String
|
|
value String
|
|
codeHash String @map("code_hash")
|
|
expiresAt DateTime @map("expires_at")
|
|
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
|
|
accountId String @map("account_id")
|
|
|
|
@@unique([accountId, type])
|
|
@@map("pending_contact_changes")
|
|
}
|
|
|
|
enum Role {
|
|
ADMIN
|
|
USER
|
|
|
|
@@map("roles")
|
|
}
|