zipline/prisma/schema.prisma

96 lines
2.4 KiB
Text
Raw Normal View History

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
2022-10-08 19:58:56 -05:00
id Int @id @default(autoincrement())
username String
password String?
oauth Boolean @default(false)
oauthProvider String?
oauthAccessToken String?
avatar String?
token String
administrator Boolean @default(false)
superAdmin Boolean @default(false)
2022-10-08 19:58:56 -05:00
systemTheme String @default("system")
embedTitle String?
embedColor String @default("#2f3136")
embedSiteName String? @default("{image.file} • {user.name}")
ratelimit DateTime?
domains String[]
images Image[]
urls Url[]
Invite Invite[]
}
2022-02-21 01:01:31 -05:00
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())
2022-07-28 15:53:46 -05:00
expires_at DateTime?
views Int @default(0)
2021-08-27 15:48:22 -05:00
favorite Boolean @default(false)
embed Boolean @default(false)
password String?
invisible InvisibleImage?
2022-02-21 01:01:31 -05:00
format ImageFormat @default(RANDOM)
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
imageId Int @unique
2021-09-17 22:39:20 -05:00
image Image @relation(fields: [imageId], references: [id])
}
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
}
model InvisibleUrl {
2021-09-24 22:31:45 -05:00
id Int @id @default(autoincrement())
invis String @unique
urlId String @unique
2021-09-24 22:31:45 -05:00
url Url @relation(fields: [urlId], references: [id])
}
2022-01-03 18:56:33 -05:00
model Stats {
id Int @id @default(autoincrement())
2022-01-03 18:56:33 -05:00
created_at DateTime @default(now())
data Json
}
2022-07-13 21:31:23 -05:00
model Invite {
2022-08-16 16:50:59 -05:00
id Int @id @default(autoincrement())
code String @unique
created_at DateTime @default(now())
2022-07-13 21:31:23 -05:00
expires_at DateTime?
2022-08-16 16:50:59 -05:00
used Boolean @default(false)
2022-07-13 21:31:23 -05:00
createdBy User @relation(fields: [createdById], references: [id])
createdById Int
}