// 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-js" output = "../src/generated/prisma" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } // Portfolio model PortfolioImage { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) fileKey String @unique originalFile String @unique fileType String name String fileSize Int needsWork Boolean @default(true) nsfw Boolean @default(false) published Boolean @default(false) setAsHeader Boolean @default(false) altText String? description String? month Int? year Int? creationDate DateTime? albumId String? typeId String? album PortfolioAlbum? @relation(fields: [albumId], references: [id]) type PortfolioType? @relation(fields: [typeId], references: [id]) metadata ImageMetadata? categories PortfolioCategory[] colors ImageColor[] sortContexts PortfolioSortContext[] tags PortfolioTag[] variants ImageVariant[] } 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 { 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 PortfolioCategory { 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 PortfolioTag { 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 PortfolioSortContext { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt year String albumId String type String group String sortOrder Int imageId String image PortfolioImage @relation(fields: [imageId], references: [id]) @@unique([imageId, year, albumId, type, group]) } 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? images ImageColor[] } model ImageColor { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt imageId String colorId String type String image PortfolioImage @relation(fields: [imageId], references: [id]) color Color @relation(fields: [colorId], references: [id]) @@unique([imageId, type]) } model ImageMetadata { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt imageId 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? image PortfolioImage @relation(fields: [imageId], references: [id]) } model ImageVariant { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt imageId String s3Key String type String height Int width Int fileExtension String? mimeType String? url String? sizeBytes Int? image PortfolioImage @relation(fields: [imageId], references: [id]) @@unique([imageId, type]) } model CommissionType { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) name String description String? options CommissionTypeOption[] extras CommissionTypeExtra[] customInputs CommissionTypeCustomInput[] requests CommissionRequest[] } model CommissionOption { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) name String description String? types CommissionTypeOption[] requests CommissionRequest[] } model CommissionExtra { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) name String description String? types CommissionTypeExtra[] } model CommissionCustomInput { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) name String @unique fieldId String types CommissionTypeCustomInput[] } model CommissionTypeOption { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) typeId String optionId String priceRange String? pricePercent Float? price Float? type CommissionType @relation(fields: [typeId], references: [id]) option CommissionOption @relation(fields: [optionId], references: [id]) @@unique([typeId, optionId]) } model CommissionTypeExtra { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) typeId String extraId String priceRange String? pricePercent Float? price Float? type CommissionType @relation(fields: [typeId], references: [id]) extra CommissionExtra @relation(fields: [extraId], references: [id]) @@unique([typeId, extraId]) } model CommissionTypeCustomInput { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt sortIndex Int @default(0) typeId String customInputId String inputType String label String required Boolean @default(false) type CommissionType @relation(fields: [typeId], references: [id]) customInput CommissionCustomInput @relation(fields: [customInputId], references: [id]) @@unique([typeId, customInputId]) } model TermsOfService { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt version Int @default(autoincrement()) markdown String } model CommissionRequest { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt customerName String customerEmail String message String optionId String? typeId String? option CommissionOption? @relation(fields: [optionId], references: [id]) type CommissionType? @relation(fields: [typeId], references: [id]) }