feat: 初始化 AstroResearch 核心系统代码及重构技术文档

This commit is contained in:
fmq
2026-06-08 17:23:27 +08:00
commit 307a1c0cee
53 changed files with 45076 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
-- migrations/20260608000001_notes.sql
-- 笔记/高亮表:每条记录对应一篇文献中某个段落的标注笔记
CREATE TABLE IF NOT EXISTS notes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
bibcode TEXT NOT NULL,
paragraph_index INTEGER NOT NULL, -- 在文章 Markdown 段落中的序号(从 0 开始)
note_text TEXT NOT NULL DEFAULT '',
highlight_color TEXT NOT NULL DEFAULT 'yellow', -- 'yellow' | 'green' | 'blue' | 'pink'
selected_text TEXT NOT NULL DEFAULT '', -- 被高亮选中的原始文本片段
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (bibcode) REFERENCES papers(bibcode) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_notes_bibcode ON notes(bibcode);