Major changes
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
model Article {
|
||||
id String @id @default(cuid())
|
||||
slug String @unique // URL-friendly title (e.g., "Albert_Einstein")
|
||||
title String // Display title
|
||||
content String @db.Text // Full markdown content
|
||||
imageUrl String? // Main image URL
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
history ArticleHistory[]
|
||||
|
||||
@@index([slug])
|
||||
}
|
||||
|
||||
model ArticleHistory {
|
||||
id String @id @default(cuid())
|
||||
articleId String
|
||||
article Article @relation(fields: [articleId], references: [id], onDelete: Cascade)
|
||||
oldContent String @db.Text
|
||||
newContent String @db.Text
|
||||
reason String // AI reason or "Initial article"
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([articleId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model Search {
|
||||
id String @id @default(cuid())
|
||||
query String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([createdAt])
|
||||
}
|
||||
Reference in New Issue
Block a user