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"
|
2022-10-12 00:38:38 +02:00
|
|
|
url = "file:../data/pingvin-share.db"
|
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
|
|
|
|
password String
|
|
|
|
isAdmin Boolean @default(false)
|
2022-10-09 22:30:32 +02:00
|
|
|
|
|
|
|
shares Share[]
|
|
|
|
refreshTokens RefreshToken[]
|
2022-12-21 17:58:37 +01:00
|
|
|
loginTokens LoginToken[]
|
|
|
|
|
|
|
|
totpEnabled Boolean @default(false)
|
|
|
|
totpVerified Boolean @default(false)
|
|
|
|
totpSecret String?
|
2022-10-09 22:30:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model RefreshToken {
|
|
|
|
token String @id @default(uuid())
|
|
|
|
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)
|
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)
|
|
|
|
}
|
|
|
|
|
2022-10-09 22:30:32 +02:00
|
|
|
model Share {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
|
|
|
|
uploadLocked Boolean @default(false)
|
|
|
|
isZipReady Boolean @default(false)
|
|
|
|
views Int @default(0)
|
|
|
|
expiration DateTime
|
2022-12-12 11:54:13 +01:00
|
|
|
description String?
|
2022-10-09 22:30:32 +02:00
|
|
|
|
2022-11-11 15:12:16 +01:00
|
|
|
creatorId String?
|
|
|
|
creator User? @relation(fields: [creatorId], references: [id], onDelete: Cascade)
|
|
|
|
security ShareSecurity?
|
|
|
|
recipients ShareRecipient[]
|
|
|
|
files File[]
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-12-01 23:07:49 +01:00
|
|
|
key String @id
|
|
|
|
type String
|
|
|
|
value String
|
|
|
|
description String
|
2022-12-30 14:40:23 +01:00
|
|
|
category String
|
2022-12-08 19:14:06 +01:00
|
|
|
obscured Boolean @default(false)
|
2022-12-01 23:07:49 +01:00
|
|
|
secret Boolean @default(true)
|
|
|
|
locked Boolean @default(false)
|
2022-11-28 15:04:32 +01:00
|
|
|
}
|