mirror of
https://github.com/yusufipk/dead-man-switch-2.0.git
synced 2026-09-11 17:36:06 +00:00
86 lines
2.2 KiB
Plaintext
86 lines
2.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
type String
|
|
provider String
|
|
providerAccountId String
|
|
refresh_token String? @db.Text
|
|
access_token String? @db.Text
|
|
expires_at Int?
|
|
token_type String?
|
|
scope String?
|
|
id_token String? @db.Text
|
|
session_state String?
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([provider, providerAccountId])
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
sessionToken String @unique
|
|
userId String
|
|
expires DateTime
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified DateTime?
|
|
image String?
|
|
accounts Account[]
|
|
sessions Session[]
|
|
messages Message[]
|
|
}
|
|
|
|
model Message {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
title String
|
|
content String? @db.Text
|
|
status String @default("DRAFT")
|
|
isEncrypted Boolean @default(false)
|
|
lastPing DateTime @default(now())
|
|
checkInterval Int @default(24)
|
|
intervalUnit String @default("HOURS")
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
recipients Recipient[]
|
|
attachments Attachment[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Recipient {
|
|
id String @id @default(cuid())
|
|
messageId String
|
|
email String
|
|
message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model Attachment {
|
|
id String @id @default(cuid())
|
|
messageId String
|
|
fileUrl String
|
|
fileName String
|
|
message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model VerificationToken {
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
}
|