Refactor for i18n, CMS integration, and project slugs; enhance admin & analytics
Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
@@ -9,6 +9,8 @@ datasource db {
|
||||
|
||||
model Project {
|
||||
id Int @id @default(autoincrement())
|
||||
slug String @unique @db.VarChar(255)
|
||||
defaultLocale String @default("en") @db.VarChar(10)
|
||||
title String @db.VarChar(255)
|
||||
description String
|
||||
content String
|
||||
@@ -39,6 +41,8 @@ model Project {
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
translations ProjectTranslation[]
|
||||
|
||||
@@index([category])
|
||||
@@index([featured])
|
||||
@@index([published])
|
||||
@@ -47,6 +51,75 @@ model Project {
|
||||
@@index([tags])
|
||||
}
|
||||
|
||||
model ProjectTranslation {
|
||||
id Int @id @default(autoincrement())
|
||||
projectId Int @map("project_id")
|
||||
locale String @db.VarChar(10)
|
||||
title String @db.VarChar(255)
|
||||
description String
|
||||
content Json?
|
||||
metaDescription String?
|
||||
keywords String?
|
||||
ogImage String? @db.VarChar(500)
|
||||
schema Json?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([projectId, locale])
|
||||
@@index([locale])
|
||||
@@index([projectId])
|
||||
@@map("project_translations")
|
||||
}
|
||||
|
||||
model ContentPage {
|
||||
id Int @id @default(autoincrement())
|
||||
key String @unique @db.VarChar(100)
|
||||
status ContentStatus @default(PUBLISHED)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
translations ContentPageTranslation[]
|
||||
|
||||
@@map("content_pages")
|
||||
}
|
||||
|
||||
model ContentPageTranslation {
|
||||
id Int @id @default(autoincrement())
|
||||
pageId Int @map("page_id")
|
||||
locale String @db.VarChar(10)
|
||||
title String?
|
||||
slug String? @db.VarChar(255)
|
||||
content Json
|
||||
metaDescription String?
|
||||
keywords String?
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
page ContentPage @relation(fields: [pageId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([pageId, locale])
|
||||
@@index([locale])
|
||||
@@index([slug])
|
||||
@@map("content_page_translations")
|
||||
}
|
||||
|
||||
model SiteSettings {
|
||||
id Int @id @default(1)
|
||||
defaultLocale String @default("en") @db.VarChar(10)
|
||||
locales String[] @default(["en","de"])
|
||||
theme Json?
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@map("site_settings")
|
||||
}
|
||||
|
||||
enum ContentStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
}
|
||||
|
||||
model PageView {
|
||||
id Int @id @default(autoincrement())
|
||||
projectId Int? @map("project_id")
|
||||
|
||||
Reference in New Issue
Block a user