mirror of
https://github.com/diced/zipline.git
synced 2025-12-05 20:40:12 -08:00
feat: storage/file quota + urls quota
This commit is contained in:
@@ -30,16 +30,37 @@ model User {
|
||||
totpSecret String?
|
||||
passkeys UserPasskey[]
|
||||
|
||||
quota UserQuota?
|
||||
|
||||
files File[]
|
||||
urls Url[]
|
||||
folders Folder[]
|
||||
limits UserLimit[]
|
||||
invites Invite[]
|
||||
tags Tag[]
|
||||
oauthProviders OAuthProvider[]
|
||||
IncompleteFile IncompleteFile[]
|
||||
}
|
||||
|
||||
model UserQuota {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
filesQuota UserFilesQuota
|
||||
maxBytes String?
|
||||
maxFiles Int?
|
||||
|
||||
maxUrls Int?
|
||||
|
||||
User User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
userId String? @unique
|
||||
}
|
||||
|
||||
enum UserFilesQuota {
|
||||
BY_BYTES
|
||||
BY_FILES
|
||||
}
|
||||
|
||||
model UserPasskey {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
@@ -85,35 +106,6 @@ enum OAuthProviderType {
|
||||
AUTHENTIK
|
||||
}
|
||||
|
||||
model UserLimit {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
type LimitType @unique
|
||||
value Int
|
||||
timeframe LimitTimeframe
|
||||
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
||||
userId String
|
||||
}
|
||||
|
||||
enum LimitType {
|
||||
UPLOAD_COUNT
|
||||
UPLOAD_SIZE
|
||||
SHORTEN_COUNT
|
||||
}
|
||||
|
||||
enum LimitTimeframe {
|
||||
SECONDLY
|
||||
MINUTELY
|
||||
HOURLY
|
||||
DAILY
|
||||
WEEKLY
|
||||
MONTHLY
|
||||
YEARLY
|
||||
}
|
||||
|
||||
model File {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Reference in New Issue
Block a user