Add CRUD for galleries

This commit is contained in:
2025-06-24 23:44:25 +02:00
parent edce8012eb
commit 0700592ebe
23 changed files with 1096 additions and 12 deletions

View File

@ -13,3 +13,37 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Gallery {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
slug String @unique
description String?
// coverImageId String?
// coverImage Image? @relation("GalleryCoverImage", fields: [coverImageId], references: [id])
albums Album[]
}
model Album {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
slug String
description String?
// coverImageId String?
galleryId String?
// coverImage Image? @relation("AlbumCoverImage", fields: [coverImageId], references: [id])
gallery Gallery? @relation(fields: [galleryId], references: [id])
// images Image[]
}