mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-05 15:30:14 +01:00
79 lines
1.7 KiB
Plaintext
79 lines
1.7 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = "file:../data/pingvin-share.db"
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
email String @unique
|
|
password String
|
|
firstName String?
|
|
lastName String?
|
|
|
|
shares Share[]
|
|
refreshTokens RefreshToken[]
|
|
}
|
|
|
|
model RefreshToken {
|
|
token String @id @default(uuid())
|
|
createdAt DateTime @default(now())
|
|
|
|
expiresAt DateTime
|
|
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
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
|
|
|
|
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)
|
|
}
|
|
|
|
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)
|
|
}
|