Add live preview to branding form showing featured image, background color, and logo. Add database fields and toggles to control visibility of each element in project headers.
185 lines
5.8 KiB
Text
185 lines
5.8 KiB
Text
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Project {
|
|
id Int @id @default(autoincrement())
|
|
slug String @unique @db.VarChar(255)
|
|
title String @db.VarChar(255)
|
|
subtitle String? @db.VarChar(255)
|
|
description String?
|
|
year Int
|
|
client String? @db.VarChar(255)
|
|
role String? @db.VarChar(255)
|
|
featuredImage String? @db.VarChar(500)
|
|
gallery Json?
|
|
externalUrl String? @db.VarChar(500)
|
|
caseStudyContent Json?
|
|
displayOrder Int @default(0)
|
|
status String @default("draft") @db.VarChar(50)
|
|
publishedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
backgroundColor String? @db.VarChar(50)
|
|
highlightColor String? @db.VarChar(50)
|
|
logoUrl String? @db.VarChar(500)
|
|
password String? @db.VarChar(255)
|
|
projectType String @default("work") @db.VarChar(50)
|
|
showFeaturedImageInHeader Boolean @default(true)
|
|
showBackgroundColorInHeader Boolean @default(true)
|
|
showLogoInHeader Boolean @default(true)
|
|
|
|
@@index([slug])
|
|
@@index([status])
|
|
}
|
|
|
|
model Post {
|
|
id Int @id @default(autoincrement())
|
|
slug String @unique @db.VarChar(255)
|
|
postType String @db.VarChar(50)
|
|
title String? @db.VarChar(255)
|
|
content Json?
|
|
featuredImage String? @db.VarChar(500)
|
|
tags Json?
|
|
status String @default("draft") @db.VarChar(50)
|
|
publishedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
attachments Json?
|
|
|
|
@@index([slug])
|
|
@@index([status])
|
|
@@index([postType])
|
|
}
|
|
|
|
model Album {
|
|
id Int @id @default(autoincrement())
|
|
slug String @unique @db.VarChar(255)
|
|
title String @db.VarChar(255)
|
|
description String?
|
|
date DateTime?
|
|
location String? @db.VarChar(255)
|
|
coverPhotoId Int?
|
|
status String @default("draft") @db.VarChar(50)
|
|
showInUniverse Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
content Json?
|
|
publishedAt DateTime?
|
|
media AlbumMedia[]
|
|
geoLocations GeoLocation[]
|
|
|
|
@@index([slug])
|
|
@@index([status])
|
|
}
|
|
|
|
model Photo {
|
|
id Int @id @default(autoincrement())
|
|
filename String @db.VarChar(255)
|
|
url String @db.VarChar(500)
|
|
thumbnailUrl String? @db.VarChar(500)
|
|
width Int?
|
|
height Int?
|
|
exifData Json?
|
|
caption String?
|
|
displayOrder Int @default(0)
|
|
slug String? @unique @db.VarChar(255)
|
|
title String? @db.VarChar(255)
|
|
description String?
|
|
status String @default("draft") @db.VarChar(50)
|
|
publishedAt DateTime?
|
|
showInPhotos Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
mediaId Int?
|
|
dominantColor String? @db.VarChar(7)
|
|
colors Json?
|
|
aspectRatio Float?
|
|
media Media? @relation(fields: [mediaId], references: [id])
|
|
|
|
@@index([slug])
|
|
@@index([status])
|
|
@@index([mediaId])
|
|
}
|
|
|
|
model Media {
|
|
id Int @id @default(autoincrement())
|
|
filename String @db.VarChar(255)
|
|
mimeType String @db.VarChar(100)
|
|
size Int
|
|
url String
|
|
thumbnailUrl String?
|
|
width Int?
|
|
height Int?
|
|
usedIn Json @default("[]")
|
|
createdAt DateTime @default(now())
|
|
description String?
|
|
originalName String? @db.VarChar(255)
|
|
updatedAt DateTime @updatedAt
|
|
isPhotography Boolean @default(false)
|
|
exifData Json?
|
|
photoCaption String?
|
|
photoTitle String? @db.VarChar(255)
|
|
photoDescription String?
|
|
photoSlug String? @unique @db.VarChar(255)
|
|
photoPublishedAt DateTime?
|
|
dominantColor String? @db.VarChar(7)
|
|
colors Json?
|
|
aspectRatio Float?
|
|
duration Float? // Video duration in seconds
|
|
videoCodec String? @db.VarChar(50)
|
|
audioCodec String? @db.VarChar(50)
|
|
bitrate Int? // Bitrate in bits per second
|
|
albums AlbumMedia[]
|
|
usage MediaUsage[]
|
|
photos Photo[]
|
|
}
|
|
|
|
model MediaUsage {
|
|
id Int @id @default(autoincrement())
|
|
mediaId Int
|
|
contentType String @db.VarChar(50)
|
|
contentId Int
|
|
fieldName String @db.VarChar(100)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
media Media @relation(fields: [mediaId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([mediaId, contentType, contentId, fieldName])
|
|
@@index([mediaId])
|
|
@@index([contentType, contentId])
|
|
}
|
|
|
|
model AlbumMedia {
|
|
id Int @id @default(autoincrement())
|
|
albumId Int
|
|
mediaId Int
|
|
displayOrder Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
album Album @relation(fields: [albumId], references: [id], onDelete: Cascade)
|
|
media Media @relation(fields: [mediaId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([albumId, mediaId])
|
|
@@index([albumId])
|
|
@@index([mediaId])
|
|
}
|
|
|
|
model GeoLocation {
|
|
id Int @id @default(autoincrement())
|
|
albumId Int
|
|
latitude Float
|
|
longitude Float
|
|
title String @db.VarChar(255)
|
|
description String?
|
|
markerColor String? @db.VarChar(7)
|
|
order Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
album Album @relation(fields: [albumId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([albumId])
|
|
}
|