End to end encrypted attachment upload and streaming
This commit is contained in:
parent
6f292756ed
commit
603d969972
63 changed files with 1926 additions and 156 deletions
|
|
@ -9,16 +9,19 @@ datasource db {
|
|||
}
|
||||
|
||||
model Community {
|
||||
id String @id @unique @default(uuid())
|
||||
name String @unique
|
||||
id String @id @unique @default(uuid())
|
||||
name String @unique
|
||||
description String?
|
||||
creationDate DateTime @default(now())
|
||||
User User @relation(name: "OwnerCommunityToUser", fields: [ownerId], references: [id])
|
||||
avatar String?
|
||||
creationDate DateTime @default(now())
|
||||
User User @relation(name: "OwnerCommunityToUser", fields: [ownerId], references: [id])
|
||||
ownerId String
|
||||
members User[] @relation(name: "MembersCommunitiesToUsers")
|
||||
members User[] @relation(name: "MembersCommunitiesToUsers")
|
||||
channels Channel[]
|
||||
roles Role[]
|
||||
invites Invite[]
|
||||
attachments Attachment[]
|
||||
chunks Chunk[]
|
||||
}
|
||||
|
||||
model Channel {
|
||||
|
|
@ -45,9 +48,11 @@ model Role {
|
|||
model User {
|
||||
id String @id @unique @default(uuid())
|
||||
username String @unique
|
||||
nickname String?
|
||||
email String? @unique
|
||||
passwordHash String?
|
||||
description String?
|
||||
avatar String?
|
||||
admin Boolean @default(false)
|
||||
registerDate DateTime @default(now())
|
||||
lastLogin DateTime?
|
||||
|
|
@ -57,6 +62,7 @@ model User {
|
|||
communities Community[] @relation(name: "MembersCommunitiesToUsers")
|
||||
roles Role[] @relation(name: "UsersRolesToUsers")
|
||||
messages Message[]
|
||||
reactions Reaction[]
|
||||
}
|
||||
|
||||
model Session {
|
||||
|
|
@ -84,14 +90,49 @@ model Invite {
|
|||
}
|
||||
|
||||
model Message {
|
||||
id String @id @unique @default(uuid())
|
||||
id String @id @unique @default(uuid())
|
||||
text String
|
||||
iv String?
|
||||
editHistory String[] @default([])
|
||||
edited Boolean @default(false)
|
||||
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
replyToId String?
|
||||
edited Boolean @default(false)
|
||||
editHistory String[] @default([])
|
||||
reactions Reaction[]
|
||||
attachments Attachment[]
|
||||
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
ownerId String
|
||||
channel Channel @relation(fields: [channelId], references: [id], onDelete: Cascade)
|
||||
channel Channel @relation(fields: [channelId], references: [id], onDelete: Cascade)
|
||||
channelId String
|
||||
creationDate DateTime @default(now())
|
||||
creationDate DateTime @default(now())
|
||||
}
|
||||
|
||||
model Reaction {
|
||||
id String @id @unique @default(uuid())
|
||||
users User[]
|
||||
content String
|
||||
message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||
messageId String
|
||||
}
|
||||
|
||||
model Attachment {
|
||||
id String @id @unique @default(uuid())
|
||||
filename String
|
||||
mimetype String
|
||||
size BigInt
|
||||
chunks Chunk[]
|
||||
finishedUploading Boolean
|
||||
message Message? @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||
messageId String?
|
||||
community Community @relation(fields: [communityId], references: [id], onDelete: Cascade)
|
||||
communityId String
|
||||
creationDate DateTime @default(now())
|
||||
}
|
||||
|
||||
model Chunk {
|
||||
id String @id @unique @default(uuid())
|
||||
iv Bytes
|
||||
index Int
|
||||
attachment Attachment @relation(fields: [attachmentId], references: [id], onDelete: Cascade)
|
||||
attachmentId String
|
||||
community Community @relation(fields: [communityId], references: [id], onDelete: Cascade)
|
||||
communityId String
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue