Add Dockerfile, add raw view

This commit is contained in:
2025-12-21 13:27:12 +01:00
parent 9bb649c9e2
commit b1541f8777
35 changed files with 2811 additions and 78 deletions

222
prisma/schema.prisma Normal file
View File

@ -0,0 +1,222 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}
datasource db {
provider = "postgresql"
}
model Artwork {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
altText String?
description String?
notes String?
month Int?
year Int?
sortKey Int?
okLabL Float?
okLabA Float?
okLabB Float?
creationDate DateTime?
needsWork Boolean @default(true)
nsfw Boolean @default(false)
published Boolean @default(false)
setAsHeader Boolean @default(false)
fileId String @unique
file FileData @relation(fields: [fileId], references: [id])
galleryId String?
gallery Gallery? @relation(fields: [galleryId], references: [id])
metadata ArtworkMetadata?
albums Album[]
categories ArtCategory[]
colors ArtworkColor[]
tags ArtTag[]
variants FileVariant[]
}
model Album {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
description String?
artworks Artwork[]
}
model Gallery {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
description String?
artworks Artwork[]
}
model ArtCategory {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
description String?
artworks Artwork[]
tags ArtTag[]
}
model ArtTag {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
description String?
aliases ArtTagAlias[]
artworks Artwork[]
categories ArtCategory[]
parentId String?
parent ArtTag? @relation("TagHierarchy", fields: [parentId], references: [id], onDelete: SetNull)
children ArtTag[] @relation("TagHierarchy")
}
model ArtTagAlias {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
alias String @unique
tagId String
tag ArtTag @relation(fields: [tagId], references: [id], onDelete: Cascade)
@@unique([tagId, alias])
@@index([alias])
}
model Color {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @unique
type String
hex String?
blue Int?
green Int?
red Int?
artworks ArtworkColor[]
}
model ArtworkColor {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
artworkId String
colorId String
type String
artwork Artwork @relation(fields: [artworkId], references: [id])
color Color @relation(fields: [colorId], references: [id])
@@unique([artworkId, type])
}
model ArtworkMetadata {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
artworkId String @unique
depth String
format String
space String
channels Int
height Int
width Int
autoOrientH Int?
autoOrientW Int?
bitsPerSample Int?
density Int?
hasAlpha Boolean?
hasProfile Boolean?
isPalette Boolean?
isProgressive Boolean?
artwork Artwork @relation(fields: [artworkId], references: [id])
}
model FileData {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
fileKey String @unique
originalFile String @unique
fileType String
name String
fileSize Int
uploadDate DateTime
artwork Artwork?
}
model FileVariant {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
s3Key String
type String
height Int
width Int
fileExtension String?
mimeType String?
url String?
sizeBytes Int?
artworkId String
artwork Artwork @relation(fields: [artworkId], references: [id])
@@unique([artworkId, type])
}