feat: improved news
This commit is contained in:
+21
-26
@@ -12,19 +12,24 @@ datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum Sex {
|
||||
MALE
|
||||
FEMALE
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
kotosoftId String @unique
|
||||
email String @unique
|
||||
firstName String
|
||||
secondName String
|
||||
sex String
|
||||
sex Sex
|
||||
birthDate DateTime
|
||||
createdAt DateTime @default(now())
|
||||
isAdmin Boolean @default(false)
|
||||
|
||||
pages Page[]
|
||||
versions PageVersion[]
|
||||
pages Page[] @relation("PageAuthor")
|
||||
editedPages Page[] @relation("PageEditor")
|
||||
}
|
||||
|
||||
enum PageStatus {
|
||||
@@ -34,25 +39,28 @@ enum PageStatus {
|
||||
}
|
||||
|
||||
enum PageType {
|
||||
PAGE
|
||||
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
|
||||
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])
|
||||
author User @relation("PageAuthor", fields: [createdBy], references: [id])
|
||||
|
||||
updatedBy String?
|
||||
editor User? @relation("PageEditor", fields: [updatedBy], references: [id])
|
||||
|
||||
blocks Block[]
|
||||
versions PageVersion[]
|
||||
}
|
||||
|
||||
model Block {
|
||||
@@ -69,17 +77,4 @@ model Block {
|
||||
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