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
|
|
|
|
|
|
|
|
email String @unique
|
|
|
|
password String
|
|
|
|
firstName String?
|
|
|
|
lastName String?
|
|
|
|
|
|
|
|
shares Share[]
|
|
|
|
refreshTokens RefreshToken[]
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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-10-18 14:27:14 +02:00
|
|
|
creatorId String?
|
|
|
|
creator User? @relation(fields: [creatorId], references: [id])
|
2022-10-09 22:30:32 +02:00
|
|
|
security ShareSecurity?
|
|
|
|
files File[]
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|