Major changes

This commit is contained in:
owenqwenstarsky
2026-01-24 16:52:19 -06:00
parent 011e40119d
commit 7181791734
46 changed files with 8371 additions and 127 deletions
+44
View File
@@ -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])
}