···11+-- Notes table
22+CREATE TABLE IF NOT EXISTS notes (
33+ id INTEGER PRIMARY KEY AUTOINCREMENT,
44+ title TEXT NOT NULL,
55+ content TEXT NOT NULL,
66+ tags TEXT, -- JSON array
77+ archived BOOLEAN DEFAULT FALSE,
88+ created DATETIME DEFAULT CURRENT_TIMESTAMP,
99+ modified DATETIME DEFAULT CURRENT_TIMESTAMP,
1010+ file_path TEXT -- optional path to source markdown file
1111+);
1212+1313+CREATE INDEX IF NOT EXISTS idx_notes_title ON notes(title);
1414+CREATE INDEX IF NOT EXISTS idx_notes_archived ON notes(archived);
1515+CREATE INDEX IF NOT EXISTS idx_notes_created ON notes(created);
1616+CREATE INDEX IF NOT EXISTS idx_notes_modified ON notes(modified);