2021-08-25 12:01:57 -05:00
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
generator client {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
2022-03-03 20:52:34 -05:00
|
|
|
id Int @id @default(autoincrement())
|
2021-08-25 12:01:57 -05:00
|
|
|
username String
|
|
|
|
password String
|
|
|
|
token String
|
2022-03-03 20:52:34 -05:00
|
|
|
administrator Boolean @default(false)
|
|
|
|
systemTheme String @default("system")
|
2021-08-25 12:01:57 -05:00
|
|
|
embedTitle String?
|
2022-03-03 20:52:34 -05:00
|
|
|
embedColor String @default("#2f3136")
|
|
|
|
embedSiteName String? @default("{image.file} • {user.name}")
|
|
|
|
ratelimited Boolean @default(false)
|
|
|
|
domains String[]
|
2021-08-25 12:01:57 -05:00
|
|
|
images Image[]
|
|
|
|
urls Url[]
|
|
|
|
}
|
|
|
|
|
2022-02-21 01:01:31 -05:00
|
|
|
enum ImageFormat {
|
|
|
|
UUID
|
|
|
|
DATE
|
|
|
|
RANDOM
|
|
|
|
NAME
|
|
|
|
}
|
|
|
|
|
2021-08-25 12:01:57 -05:00
|
|
|
model Image {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
file String
|
|
|
|
mimetype String @default("image/png")
|
|
|
|
created_at DateTime @default(now())
|
|
|
|
views Int @default(0)
|
2021-08-27 15:48:22 -05:00
|
|
|
favorite Boolean @default(false)
|
2021-09-02 22:59:30 -05:00
|
|
|
embed Boolean @default(false)
|
2021-08-25 12:01:57 -05:00
|
|
|
invisible InvisibleImage?
|
2022-02-21 01:01:31 -05:00
|
|
|
format ImageFormat @default(RANDOM)
|
2021-08-25 12:01:57 -05:00
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
userId Int
|
|
|
|
}
|
|
|
|
|
|
|
|
model InvisibleImage {
|
2021-09-17 22:39:20 -05:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
invis String @unique
|
2021-08-30 22:56:34 -05:00
|
|
|
imageId Int
|
2021-09-17 22:39:20 -05:00
|
|
|
image Image @relation(fields: [imageId], references: [id])
|
2021-08-25 12:01:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
model Url {
|
2021-09-24 22:31:45 -05:00
|
|
|
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
|
2021-08-25 12:01:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
model InvisibleUrl {
|
2021-09-24 22:31:45 -05:00
|
|
|
id Int @id @default(autoincrement())
|
2021-08-26 14:32:51 -05:00
|
|
|
invis String @unique
|
2021-09-24 22:31:45 -05:00
|
|
|
urlId String
|
|
|
|
url Url @relation(fields: [urlId], references: [id])
|
2021-08-25 12:01:57 -05:00
|
|
|
}
|
2022-01-03 18:56:33 -05:00
|
|
|
|
|
|
|
model Stats {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
created_at DateTime @default(now())
|
|
|
|
data Json
|
|
|
|
}
|