75 lines
No EOL
1.8 KiB
Text
75 lines
No EOL
1.8 KiB
Text
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
username String
|
|
password String
|
|
token String
|
|
administrator Boolean @default(false)
|
|
systemTheme String @default("system")
|
|
embedTitle String?
|
|
embedColor String @default("#2f3136")
|
|
embedSiteName String? @default("{image.file} • {user.name}")
|
|
ratelimited Boolean @default(false)
|
|
images Image[]
|
|
urls Url[]
|
|
}
|
|
|
|
enum ImageFormat {
|
|
UUID
|
|
DATE
|
|
RANDOM
|
|
NAME
|
|
}
|
|
|
|
model Image {
|
|
id Int @id @default(autoincrement())
|
|
file String
|
|
mimetype String @default("image/png")
|
|
created_at DateTime @default(now())
|
|
views Int @default(0)
|
|
favorite Boolean @default(false)
|
|
embed Boolean @default(false)
|
|
invisible InvisibleImage?
|
|
format ImageFormat @default(RANDOM)
|
|
user User @relation(fields: [userId], references: [id])
|
|
userId Int
|
|
}
|
|
|
|
model InvisibleImage {
|
|
id Int @id @default(autoincrement())
|
|
invis String @unique
|
|
imageId Int
|
|
image Image @relation(fields: [imageId], references: [id])
|
|
}
|
|
|
|
model Url {
|
|
id String @id @unique
|
|
destination String
|
|
vanity String?
|
|
created_at DateTime @default(now())
|
|
views Int @default(0)
|
|
invisible InvisibleUrl?
|
|
user User @relation(fields: [userId], references: [id])
|
|
userId Int
|
|
}
|
|
|
|
model InvisibleUrl {
|
|
id Int @id @default(autoincrement())
|
|
invis String @unique
|
|
urlId String
|
|
url Url @relation(fields: [urlId], references: [id])
|
|
}
|
|
|
|
model Stats {
|
|
id Int @id @default(autoincrement())
|
|
created_at DateTime @default(now())
|
|
data Json
|
|
} |