Skip to content

Commit b15992a

Browse files
committed
v1.0.7
1 parent d9d6794 commit b15992a

File tree

20 files changed

+2129
-141
lines changed

20 files changed

+2129
-141
lines changed

doc/development/backend-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
- `get_note_detail(id)`
6767
- 返回: `{ id, title, content, createdAt, updatedAt }`
6868

69-
- `update_note_content(id, { title, content, links })`
70-
- `links[]`: `{ refType: 'paper'|'task'|'note', refId, label? }`
71-
- 保存时重建该笔记在 `note_links` 中的结构化双链关系
69+
- `update_note_content(id, { title, content, expectedUpdatedAt?, saveSource? })`
70+
- 后端会从 `content`(Tiptap JSON)中提取 `noteReference` 并重建 `note_links`
71+
- 当引用目标不存在时会跳过该引用并继续保存,返回 `skippedLinks[]`
7272

7373
- `get_note_linked_context(id)`
7474
- 返回: `{ papers[], tasks[], notes[] }`

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./dist/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "DeepLab",
33
"private": true,
4-
"version": "1.0.6",
4+
"version": "1.0.7",
55
"type": "module",
66
"packageManager": "pnpm@10.30.1",
77
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deeplab"
3-
version = "1.0.6"
3+
version = "1.0.7"
44
description = "AI科研辅助平台"
55
authors = ["timechess"]
66
edition = "2021"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ALTER TABLE notes ADD COLUMN content_hash TEXT NOT NULL DEFAULT '';
2+
3+
CREATE TABLE IF NOT EXISTS note_revisions (
4+
id INTEGER PRIMARY KEY AUTOINCREMENT,
5+
note_id INTEGER NOT NULL,
6+
title TEXT NOT NULL,
7+
content TEXT NOT NULL,
8+
content_length INTEGER NOT NULL,
9+
source TEXT NOT NULL DEFAULT 'unknown',
10+
createdAt TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
11+
content_hash TEXT NOT NULL DEFAULT '',
12+
snapshot_size INTEGER NOT NULL DEFAULT 0,
13+
FOREIGN KEY (note_id) REFERENCES notes (id) ON DELETE CASCADE
14+
);
15+
16+
UPDATE notes
17+
SET content_hash = printf('%016x', id)
18+
WHERE COALESCE(content_hash, '') = '';
19+
20+
UPDATE note_revisions
21+
SET content_hash = printf('%016x', id)
22+
WHERE COALESCE(content_hash, '') = '';
23+
24+
UPDATE note_revisions
25+
SET snapshot_size = length(content)
26+
WHERE COALESCE(snapshot_size, 0) <= 0;
27+
28+
CREATE INDEX IF NOT EXISTS idx_notes_content_hash ON notes (content_hash);
29+
CREATE INDEX IF NOT EXISTS idx_note_revisions_note_id ON note_revisions (note_id);
30+
CREATE INDEX IF NOT EXISTS idx_note_revisions_note_id_desc ON note_revisions (note_id, id DESC);
31+
CREATE INDEX IF NOT EXISTS idx_note_revisions_created_at ON note_revisions (createdAt);
32+
CREATE INDEX IF NOT EXISTS idx_note_revisions_note_hash ON note_revisions (note_id, content_hash);

0 commit comments

Comments
 (0)