main
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-03-23 02:34:03 +03:00
parent 83b0ae61a8
commit e60b6ea526
8 changed files with 667 additions and 1 deletions

View File

@@ -181,6 +181,10 @@ model ScriptProject {
highConcept String? @db.Text
includeInterviews Boolean @default(false)
// Project Status
status String @default("DRAFT") // DRAFT, RESEARCHING, SCRIPTING, ANALYZING, COMPLETED
currentVersionNumber Int @default(0)
// SEO Data (stored as JSON)
seoTitle String?
seoDescription String? @db.Text
@@ -205,9 +209,11 @@ model ScriptProject {
characters CharacterProfile[]
briefItems BriefItem[]
visualAssets VisualAsset[]
versions ScriptVersion[]
@@index([userId])
@@index([topic])
@@index([status])
}
model ScriptSegment {
@@ -312,3 +318,36 @@ model VisualAsset {
@@index([projectId])
}
// ============================================
// Version History
// ============================================
model ScriptVersion {
id String @id @default(uuid())
projectId String
versionNumber Int
label String? // User-defined label, e.g. "Final Draft", "Before Rewrite"
generatedBy String @default("AI") // AI | USER | AUTO_SAVE
// Snapshot data: complete segments at this point in time
snapshotData Json // Array of segment objects
// Optional: SEO snapshot
seoSnapshot Json? // { seoTitle, seoDescription, seoTags, thumbnailIdeas }
// Metadata
segmentCount Int @default(0)
totalWords Int @default(0)
changeNote String? @db.Text // What changed in this version
// Timestamps
createdAt DateTime @default(now())
// Relations
project ScriptProject @relation(fields: [projectId], references: [id], onDelete: Cascade)
@@unique([projectId, versionNumber])
@@index([projectId])
@@index([createdAt])
}