added file upload and storage
This commit is contained in:
@@ -16,6 +16,8 @@ model User {
|
||||
role Role @default(GUEST)
|
||||
events Event[] @relation("EventCreator")
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
FileUpload FileUpload[]
|
||||
}
|
||||
|
||||
enum Role {
|
||||
@@ -37,6 +39,8 @@ model Event {
|
||||
notes String?
|
||||
todos EventTodo[]
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
FileUpload FileUpload[]
|
||||
}
|
||||
|
||||
model Location {
|
||||
@@ -119,3 +123,18 @@ model EventTodo {
|
||||
// category String?
|
||||
// assignedTo String? // could link to User in future
|
||||
}
|
||||
|
||||
model FileUpload {
|
||||
id String @id @default(cuid())
|
||||
filepath String
|
||||
filename String
|
||||
filetype String
|
||||
filesize Int //in bytes
|
||||
uploadedAt DateTime @default(now())
|
||||
uploadedBy User @relation(fields: [uploadedById], references: [id])
|
||||
uploadedById String
|
||||
event Event? @relation(fields: [eventId], references: [id])
|
||||
eventId String?
|
||||
|
||||
@@unique([filename, uploadedById])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user