2022-10-09 22:30:32 +02:00
|
|
|
generator client {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
2022-10-11 22:30:06 +02:00
|
|
|
provider = "sqlite"
|
2023-05-05 11:37:02 +02:00
|
|
|
url = env("DATABASE_URL")
|
2022-10-09 22:30:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
|
2022-12-01 23:07:49 +01:00
|
|
|
username String @unique
|
|
|
|
email String @unique
|
2023-10-22 16:09:53 +02:00
|
|
|
password String?
|
2022-12-01 23:07:49 +01:00
|
|
|
isAdmin Boolean @default(false)
|
2024-08-24 16:15:33 +02:00
|
|
|
ldapDN String? @unique
|
2022-10-09 22:30:32 +02:00
|
|
|
|
|
|
|
shares Share[]
|
|
|
|
refreshTokens RefreshToken[]
|
2022-12-21 17:58:37 +01:00
|
|
|
loginTokens LoginToken[]
|
2023-01-26 13:44:04 +01:00
|
|
|
reverseShares ReverseShare[]
|
2022-12-21 17:58:37 +01:00
|
|
|
|
2023-02-10 11:10:07 +01:00
|
|
|
totpEnabled Boolean @default(false)
|
|
|
|
totpVerified Boolean @default(false)
|
2023-02-09 18:17:53 +01:00
|
|
|
totpSecret String?
|
|
|
|
resetPasswordToken ResetPasswordToken?
|
2023-10-22 16:09:53 +02:00
|
|
|
|
|
|
|
oAuthUsers OAuthUser[]
|
2022-10-09 22:30:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model RefreshToken {
|
2023-01-04 11:54:28 +01:00
|
|
|
id String @id @default(uuid())
|
|
|
|
token String @unique @default(uuid())
|
2022-10-09 22:30:32 +02:00
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
2022-10-11 22:30:06 +02:00
|
|
|
expiresAt DateTime
|
2022-10-09 22:30:32 +02:00
|
|
|
|
|
|
|
userId String
|
2022-10-13 23:26:56 +02:00
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2024-10-14 18:16:47 +02:00
|
|
|
|
|
|
|
oauthIDToken String? // prefixed with the ID of the issuing OAuth provider, separated by a colon
|
2022-10-09 22:30:32 +02:00
|
|
|
}
|
|
|
|
|
2022-12-21 17:58:37 +01:00
|
|
|
model LoginToken {
|
|
|
|
token String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
expiresAt DateTime
|
|
|
|
|
|
|
|
userId String
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
used Boolean @default(false)
|
|
|
|
}
|
|
|
|
|
2023-02-09 18:17:53 +01:00
|
|
|
model ResetPasswordToken {
|
|
|
|
token String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
expiresAt DateTime
|
|
|
|
|
|
|
|
userId String @unique
|
2023-02-10 11:10:07 +01:00
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-02-09 18:17:53 +01:00
|
|
|
}
|
|
|
|
|
2023-10-22 16:09:53 +02:00
|
|
|
model OAuthUser {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
provider String
|
|
|
|
providerUserId String
|
|
|
|
providerUsername String
|
|
|
|
userId String
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
}
|
|
|
|
|
2022-10-09 22:30:32 +02:00
|
|
|
model Share {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
2024-05-03 17:12:26 +02:00
|
|
|
name String?
|
2023-01-13 10:16:35 +01:00
|
|
|
uploadLocked Boolean @default(false)
|
|
|
|
isZipReady Boolean @default(false)
|
|
|
|
views Int @default(0)
|
|
|
|
expiration DateTime
|
|
|
|
description String?
|
|
|
|
removedReason String?
|
2022-10-09 22:30:32 +02:00
|
|
|
|
2023-01-26 13:44:04 +01:00
|
|
|
creatorId String?
|
|
|
|
creator User? @relation(fields: [creatorId], references: [id], onDelete: Cascade)
|
|
|
|
|
2023-02-10 11:10:07 +01:00
|
|
|
reverseShareId String?
|
|
|
|
reverseShare ReverseShare? @relation(fields: [reverseShareId], references: [id], onDelete: Cascade)
|
2023-01-26 13:44:04 +01:00
|
|
|
|
2022-11-11 15:12:16 +01:00
|
|
|
security ShareSecurity?
|
|
|
|
recipients ShareRecipient[]
|
|
|
|
files File[]
|
|
|
|
}
|
|
|
|
|
2023-01-26 13:44:04 +01:00
|
|
|
model ReverseShare {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
token String @unique @default(uuid())
|
|
|
|
shareExpiration DateTime
|
|
|
|
maxShareSize String
|
|
|
|
sendEmailNotification Boolean
|
2023-02-10 11:10:07 +01:00
|
|
|
remainingUses Int
|
2024-07-30 08:26:56 +02:00
|
|
|
simplified Boolean @default(false)
|
|
|
|
publicAccess Boolean @default(true)
|
2023-01-26 13:44:04 +01:00
|
|
|
|
|
|
|
creatorId String
|
|
|
|
creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
|
|
|
|
|
2023-02-10 11:10:07 +01:00
|
|
|
shares Share[]
|
2023-01-26 13:44:04 +01:00
|
|
|
}
|
|
|
|
|
2022-11-11 15:12:16 +01:00
|
|
|
model ShareRecipient {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
email String
|
|
|
|
|
|
|
|
shareId String
|
|
|
|
share Share @relation(fields: [shareId], references: [id], onDelete: Cascade)
|
2022-10-09 22:30:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model File {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
name String
|
|
|
|
size String
|
|
|
|
|
|
|
|
shareId String
|
|
|
|
share Share @relation(fields: [shareId], references: [id], onDelete: Cascade)
|
|
|
|
}
|
|
|
|
|
|
|
|
model ShareSecurity {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
password String?
|
|
|
|
maxViews Int?
|
|
|
|
|
|
|
|
shareId String? @unique
|
|
|
|
share Share? @relation(fields: [shareId], references: [id], onDelete: Cascade)
|
|
|
|
}
|
2022-11-28 15:04:32 +01:00
|
|
|
|
|
|
|
model Config {
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
|
2023-03-23 08:31:21 +01:00
|
|
|
name String
|
|
|
|
category String
|
|
|
|
type String
|
2023-10-22 16:09:53 +02:00
|
|
|
defaultValue String @default("")
|
2023-03-23 08:31:21 +01:00
|
|
|
value String?
|
|
|
|
obscured Boolean @default(false)
|
|
|
|
secret Boolean @default(true)
|
|
|
|
locked Boolean @default(false)
|
|
|
|
order Int
|
2023-03-04 23:29:00 +01:00
|
|
|
|
|
|
|
@@id([name, category])
|
2022-11-28 15:04:32 +01:00
|
|
|
}
|