feat(i18n): add localized navigation and news translations
This commit is contained in:
@@ -16,6 +16,22 @@ model Post {
|
||||
status String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
translations PostTranslation[]
|
||||
}
|
||||
|
||||
model PostTranslation {
|
||||
id String @id @default(uuid())
|
||||
postId String
|
||||
locale String
|
||||
title String
|
||||
excerpt String?
|
||||
body String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([postId, locale])
|
||||
@@index([locale])
|
||||
}
|
||||
|
||||
model User {
|
||||
@@ -315,6 +331,7 @@ model NavigationItem {
|
||||
page Page? @relation(fields: [pageId], references: [id], onDelete: SetNull)
|
||||
parent NavigationItem? @relation("NavigationItemParent", fields: [parentId], references: [id], onDelete: Cascade)
|
||||
children NavigationItem[] @relation("NavigationItemParent")
|
||||
translations NavigationItemTranslation[]
|
||||
|
||||
@@index([menuId])
|
||||
@@index([pageId])
|
||||
@@ -322,6 +339,19 @@ model NavigationItem {
|
||||
@@unique([menuId, parentId, sortOrder, label])
|
||||
}
|
||||
|
||||
model NavigationItemTranslation {
|
||||
id String @id @default(uuid())
|
||||
navigationItemId String
|
||||
locale String
|
||||
label String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
navigationItem NavigationItem @relation(fields: [navigationItemId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([navigationItemId, locale])
|
||||
@@index([locale])
|
||||
}
|
||||
|
||||
model Customer {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
|
||||
Reference in New Issue
Block a user