44 lines
1.3 KiB
Plaintext
44 lines
1.3 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
|
|
s3Key String
|
|
status String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
uploadedById Int
|
|
uploadedBy User @relation("UploadedDocuments", fields: [uploadedById], references: [id])
|
|
Notification Notification[]
|
|
sharedWith User[] @relation("SharedDocuments")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique
|
|
name String?
|
|
password String
|
|
isAdmin Boolean @default(false)
|
|
uploadedDocuments Document[] @relation("UploadedDocuments")
|
|
Notification Notification[]
|
|
sharedDocuments Document[] @relation("SharedDocuments")
|
|
}
|
|
|
|
model Notification {
|
|
id Int @id @default(autoincrement())
|
|
message String
|
|
read Boolean @default(false)
|
|
userId Int
|
|
createdAt DateTime @default(now())
|
|
documentId Int
|
|
document Document @relation(fields: [documentId], references: [id])
|
|
user User @relation(fields: [userId], references: [id])
|
|
}
|