blog-server/prisma/schema.prisma

104 lines
2.3 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Post {
id String @id @default(uuid())
title String
slug String @unique
description String
content String
series String
tags String @default("[]")
published Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
comments FediverseComment[]
@@map("posts")
}
model CustomPage {
id String @id @default(uuid())
title String
slug String @unique
description String
content String
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
@@map("custom_pages")
}
model Friend {
id Int @id @default(autoincrement())
name String
email String?
avatar String?
siteName String @map("site_name")
siteUrl String @map("site_url")
description String
createdAt DateTime @default(now())
deletedAt DateTime?
@@map("friends")
}
model Config {
id Int @id @default(autoincrement())
key String @unique
value String
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
@@map("configs")
}
model FediverseGuest {
id Int @id @default(autoincrement())
name String
uid String @unique
summary String?
url String
webUrl String?
avatar String?
banner String?
follow Boolean @default(false)
inbox String @default("")
outbox String @default("")
raw String @default("")
keyId String
publicKey String
isBanned Boolean @default(false)
comments FediverseComment[]
@@map("fediverse_guests")
}
model FediverseComment {
id Int @id @default(autoincrement())
uid String @unique
userId String
content String // HTML
source String? // markdown
parsed String // serialized HTML AST
images String @default("[]")
replyTo String?
postId String
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
isHidden Boolean @default(false)
user FediverseGuest @relation(fields: [userId], references: [uid])
post Post @relation(fields: [postId], references: [id])
@@map("fediverse_comments")
}