zipline/prisma/schema.prisma

76 lines
1.9 KiB
Text
Raw Normal View History

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("dark_blue")
customTheme Theme?
embedTitle String?
embedColor String @default("#2f3136")
images Image[]
urls Url[]
}
model Theme {
id Int @id @default(autoincrement())
type String
primary String
secondary String
error String
warning String
info String
border String
mainBackground String
paperBackground String
user User @relation(fields: [userId], references: [id])
userId Int
}
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)
embed Boolean @default(false)
invisible InvisibleImage?
user User @relation(fields: [userId], references: [id])
userId Int
}
model InvisibleImage {
2021-08-30 22:56:34 -05:00
id Int @id @default(autoincrement())
invis String @unique
2021-08-30 22:56:34 -05:00
imageId Int
image Image @relation(fields: [imageId], references: [id])
}
model Url {
id Int @id @default(autoincrement())
to 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
url Url @relation(fields: [id], references: [id])
invis String @unique
}