feat(pages): add pages and navigation builder baseline
This commit is contained in:
@@ -252,3 +252,53 @@ model ArtworkTag {
|
||||
@@unique([artworkId, tagId])
|
||||
@@index([tagId])
|
||||
}
|
||||
|
||||
model Page {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
slug String @unique
|
||||
status String
|
||||
summary String?
|
||||
content String
|
||||
seoTitle String?
|
||||
seoDescription String?
|
||||
publishedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
navItems NavigationItem[]
|
||||
|
||||
@@index([status])
|
||||
}
|
||||
|
||||
model NavigationMenu {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
slug String @unique
|
||||
location String
|
||||
isVisible Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
items NavigationItem[]
|
||||
}
|
||||
|
||||
model NavigationItem {
|
||||
id String @id @default(uuid())
|
||||
menuId String
|
||||
pageId String?
|
||||
label String
|
||||
href String?
|
||||
parentId String?
|
||||
sortOrder Int @default(0)
|
||||
isVisible Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
menu NavigationMenu @relation(fields: [menuId], references: [id], onDelete: Cascade)
|
||||
page Page? @relation(fields: [pageId], references: [id], onDelete: SetNull)
|
||||
parent NavigationItem? @relation("NavigationItemParent", fields: [parentId], references: [id], onDelete: Cascade)
|
||||
children NavigationItem[] @relation("NavigationItemParent")
|
||||
|
||||
@@index([menuId])
|
||||
@@index([pageId])
|
||||
@@index([parentId])
|
||||
@@unique([menuId, parentId, sortOrder, label])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user