Refactor mosaic

This commit is contained in:
2025-07-22 00:33:32 +02:00
parent a8d5dbaa09
commit 9962bb1476
5 changed files with 191 additions and 27 deletions

View File

@ -25,8 +25,9 @@ model PortfolioImage {
originalFile String @unique
name String
nsfw Boolean @default(false)
published Boolean @default(true)
published Boolean @default(false)
setAsHeader Boolean @default(false)
needsWork Boolean @default(false)
altText String?
description String?
@ -43,8 +44,10 @@ model PortfolioImage {
// slug String?
// fileSize Int?
typeId String?
type PortfolioType? @relation(fields: [typeId], references: [id])
albumId String?
typeId String?
album PortfolioAlbum? @relation(fields: [albumId], references: [id])
type PortfolioType? @relation(fields: [typeId], references: [id])
metadata ImageMetadata?
@ -52,6 +55,23 @@ model PortfolioImage {
colors ImageColor[]
tags PortfolioTag[]
variants ImageVariant[]
@@index([typeId, year, layoutGroup, layoutOrder])
@@index([albumId, layoutGroup, layoutOrder])
}
model PortfolioAlbum {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sortIndex Int @default(0)
name String @unique
slug String @unique
description String?
images PortfolioImage[]
}
model PortfolioType {