Add Image OCR search, Note Version History & Shared Notebooks

This commit is contained in:
chrisf committed 2026-10-22 22:48:36 -06:00
1 parent 247b63691a
commit 969b6ef083
21 files changed
+2166 -100

No files matched your search

+55 -24
View File
@@ -30,36 +30,51 @@ model NotebookStack {
}
model Notebook {
id String @id @default(cuid())
userId String @default("default")
name String
stackId String?
stack NotebookStack? @relation(fields: [stackId], references: [id], onDelete: SetNull)
isDefault Boolean @default(false)
isShortcut Boolean @default(false)
sortOrder Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
notes Note[]
id String @id @default(cuid())
userId String @default("default")
name String
stackId String?
stack NotebookStack? @relation(fields: [stackId], references: [id], onDelete: SetNull)
isDefault Boolean @default(false)
isShortcut Boolean @default(false)
sortOrder Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
notes Note[]
autoSortRules AutoSortRule[]
shares NotebookShare[]
@@unique([userId, name])
@@index([userId])
@@index([stackId])
}
model NotebookShare {
id String @id @default(cuid())
notebookId String
notebook Notebook @relation(fields: [notebookId], references: [id], onDelete: Cascade)
userId String // Collaborator user ID
role String @default("write") // "read" | "write"
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([notebookId, userId])
@@index([userId])
@@index([notebookId])
}
model Note {
id String @id @default(cuid())
userId String @default("default")
title String @default("Untitled Note")
contentHtml String @default("")
contentText String @default("")
excerpt String @default("")
id String @id @default(cuid())
userId String @default("default")
title String @default("Untitled Note")
contentHtml String @default("")
contentText String @default("")
excerpt String @default("")
notebookId String
notebook Notebook @relation(fields: [notebookId], references: [id], onDelete: Cascade)
isPinned Boolean @default(false)
isShortcut Boolean @default(false)
isTrashed Boolean @default(false)
notebook Notebook @relation(fields: [notebookId], references: [id], onDelete: Cascade)
isPinned Boolean @default(false)
isShortcut Boolean @default(false)
isTrashed Boolean @default(false)
trashedAt DateTime?
thumbnailUrl String?
sourceUrl String?
@@ -67,11 +82,12 @@ model Note {
latitude Float?
longitude Float?
reminderAt DateTime?
reminderDone Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
reminderDone Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
tags NoteTag[]
attachments Attachment[]
history NoteHistory[]
@@index([userId, isTrashed, isPinned, updatedAt(sort: Desc)])
@@index([notebookId, isTrashed, updatedAt(sort: Desc)])
@@ -81,6 +97,21 @@ model Note {
@@index([title])
}
model NoteHistory {
id String @id @default(cuid())
noteId String
note Note @relation(fields: [noteId], references: [id], onDelete: Cascade)
title String
contentHtml String
contentText String
excerpt String @default("")
wordCount Int @default(0)
createdBy String?
createdAt DateTime @default(now())
@@index([noteId, createdAt(sort: Desc)])
}
model Tag {
id String @id @default(cuid())
userId String @default("default")