40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Document {
|
|
id Int @id @default(autoincrement())
|
|
title String
|
|
content String?
|
|
s3Key String
|
|
status String @default("pending")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
sharedWithId Int
|
|
sharedWith User @relation("SharedDocuments", fields: [sharedWithId], references: [id])
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique
|
|
name String?
|
|
password String
|
|
isAdmin Boolean @default(false)
|
|
sharedDocuments Document[] @relation("SharedDocuments")
|
|
notifications Notification[]
|
|
}
|
|
|
|
model Notification {
|
|
id Int @id @default(autoincrement())
|
|
message String
|
|
read Boolean @default(false)
|
|
userId Int
|
|
createdAt DateTime @default(now())
|
|
user User @relation(fields: [userId], references: [id])
|
|
}
|