feat: basic pages system
This commit is contained in:
+69
-9
@@ -13,13 +13,73 @@ datasource db {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
kotosoftId String @unique
|
||||
email String @unique
|
||||
firstName String
|
||||
secondName String
|
||||
sex String
|
||||
birthDate DateTime
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
id String @id @default(uuid())
|
||||
kotosoftId String @unique
|
||||
email String @unique
|
||||
firstName String
|
||||
secondName String
|
||||
sex String
|
||||
birthDate DateTime
|
||||
createdAt DateTime @default(now())
|
||||
isAdmin Boolean @default(false)
|
||||
|
||||
pages Page[]
|
||||
versions PageVersion[]
|
||||
}
|
||||
|
||||
enum PageStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
ARCHIVED
|
||||
}
|
||||
|
||||
enum PageType {
|
||||
NEWS
|
||||
}
|
||||
|
||||
model Page {
|
||||
id String @id @default(uuid())
|
||||
slug String @unique
|
||||
title String
|
||||
type PageType
|
||||
status PageStatus @default(DRAFT)
|
||||
meta Json @default("{}")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
publishedAt DateTime?
|
||||
|
||||
createdBy String
|
||||
author User @relation(fields: [createdBy], references: [id])
|
||||
|
||||
blocks Block[]
|
||||
versions PageVersion[]
|
||||
}
|
||||
|
||||
model Block {
|
||||
id String @id @default(uuid())
|
||||
pageId String
|
||||
page Page @relation(fields: [pageId], references: [id], onDelete: Cascade)
|
||||
|
||||
parentId String?
|
||||
parent Block? @relation("BlockChildren", fields: [parentId], references: [id])
|
||||
children Block[] @relation("BlockChildren")
|
||||
|
||||
type String
|
||||
position Float
|
||||
content Json
|
||||
|
||||
@@index([pageId, position])
|
||||
}
|
||||
|
||||
model PageVersion {
|
||||
id String @id @default(uuid())
|
||||
pageId String
|
||||
page Page @relation(fields: [pageId], references: [id], onDelete: Cascade)
|
||||
|
||||
title String
|
||||
blocks Json
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
createdBy String
|
||||
author User @relation(fields: [createdBy], references: [id])
|
||||
}
|
||||
Reference in New Issue
Block a user