feat: 初始化 AstroResearch 核心系统代码及重构技术文档
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user